Match #1
Range: 0-20Capture groups
Test JavaScript regular expressions in real time. Highlight matches, inspect capture groups, switch flags, and start from practical presets.
Last updated:
Supports JavaScript flags: d, g, i, m, s, u, v, y.
Flags
2 matches
Capture groups
Capture groups
A regular expression can match more or less text than expected. Try a pattern and flags against realistic sample input, then inspect each match and capture group before putting the expression into code.
This tool uses JavaScript RegExp syntax. A pattern accepted by another engine, such as PCRE or Python, may behave differently. The preview shows at most 500 matches.
Patterns are evaluated by the JavaScript RegExp engine in your browser.
Yes. Match details include numbered groups and named groups when your pattern defines them.
Add the g flag to search for all matches. Without it, JavaScript returns the first match.
No. Matching runs locally in your browser.
The interface limits the preview to the first 500 matches so very broad patterns remain usable.
Compare text before and after a pattern-based edit.
Inspect structured sample data separately from regex matching.