JavaScript RegExp Guide
Regular expressions are patterns used to match character combinations in strings. JavaScript supports both literal and constructor syntax for creating regexes. The guide walks through Creating Regular Expressions, Testing & Matching, Replacing & Splitting. Use literal syntax `/pattern/flags` or `new RegExp("pattern", "flags")`. Common flags: `g` (global), `i` (case-insensitive), `m` (multiline), `s` (dotall), `u` (unicode), `y` (sticky). `test()` returns boolean for a match. `exec()` returns detailed match information including groups and position. `String.prototype.match()` and `matchAll()` provide string-based matching. The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code. Browse the individual methods covered by this guide in the RegExp category. Key APIs covered include RegExp.prototype.test(), RegExp.prototype.exec(), RegExp.prototype.source, RegExp.prototype.flags, RegExp.prototype.lastIndex, RegExp.prototype.global. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page.