Reference
Regex Syntax
A reference for the core regular-expression syntax: classes, quantifiers, anchors, and groups.
A regular expression is a small language for describing text patterns. The core building blocks are character classes, quantifiers, anchors, and groups.
01Core building blocks
- Character classes: [abc], [^abc], and shorthand such as \d and \w.
- Quantifiers: *, +, ?, and {m,n}, greedy or lazy.
- Anchors: ^ and $, with multiline behavior controlled by flags.
- Groups: capturing ( ) and non-capturing (?: ).
Flags change meaning
The same pattern matches differently with the global, case-insensitive, multiline, or dotAll flags.
02Limitations
This is not a complete ECMAScript specification and omits engine-specific extensions.
Sources
- MDN: Regular expressions — MDN Web Docs (accessed 2026-09-01)
Test this in your browser
The tool runs entirely in your browser; the input you use never leaves it.
About the author
Gampangin builds and maintains free, browser-based developer tools and the documentation that makes them trustworthy. The organization is accountable for every page published on this site.