How to use this developer tool
- Enter the source text.
- Provide a JavaScript pattern without slash delimiters and choose flags.
- Extract matches and review positions plus numbered captures.
- Export rows when the results need further analysis.
Run a JavaScript regular expression against text and extract every match with its index and capture values. The tool safely adds global iteration when needed, handles zero-length matches without looping forever, and exports structured rows for debugging parsers, log searches, and migration scripts.
Each line lists the full match, its zero-based index, and any captured substrings.
Regular expressions are code-like input; avoid testing unknown complex patterns against large text.
Pattern: #[0-9a-f]{6}
Text: Colors #aabbcc and #112233
Matches: two hex valuesIf g is absent it is added for extraction while other supplied flags are preserved. Indices refer to UTF-16 code-unit offsets used by JavaScript.
The browser engine determines supported syntax. Lookbehind and newer flags may not exist in older browsers.
Patterns use the JavaScript regular expression engine available in your browser.
The tool reports the JavaScript syntax error and does not process the input text.
Pathological patterns can cause catastrophic backtracking. Test untrusted patterns on small input first.
Only when the Unicode-related flag and pattern semantics call for it; otherwise JavaScript uses UTF-16 code units.
No. Matching and replacement run in the current browser tab.
| Field | Meaning |
|---|---|
| Summary | High-level processing result |
| Statistics | Counts and validation details |
| Export | Copy-ready text plus structured data when available |
Browse more tools for code formatting & regex.
Open category hub