Match foo with capture group
Input
(foo)foo bar fooExample output
--- Found 2 matches ---
Match 1 (index 0..3): "foo"
Group 1: "foo"
Match 2 (index 8..11): "foo"
Group 1: "foo"Test a JavaScript regular expression against sample text, inspect every match with capture groups and offsets, or substitute matches with group-aware replacement — with worker deadline protection.
| Inputs | Two panes: a pattern slot and a test-text slot |
|---|---|
| Operations | Match with groups and offsets, boolean test, or group-aware replace |
| Flags | Toggles for i, m, s, and u, unioned with inline flags; global matching is always on |
| Max input size | 500 KB |
| Execution deadline | 750 ms |
| Processing location | Browser-only: pasted input is not uploaded |
Input
(foo)foo bar fooExample output
--- Found 2 matches ---
Match 1 (index 0..3): "foo"
Group 1: "foo"
Match 2 (index 8..11): "foo"
Group 1: "foo"Input
(foo)fooExample output
foofooThe unicode toggle defaults to true, so some legacy patterns only compile with it disabled; inline u in /pattern/flags notation also enables it.
Zero-width matches advance safely, with surrogate-pair awareness, instead of looping forever.
The match listing stops at a bounded count with an OUTPUT_TRUNCATED warning; the replace counting loop is not capped the same way.
Text Diff / Compare
Compare two text files, code snippets, or configuration payloads line-by-line, word-by-word, or as a unified patch.
Case Converter
Convert text, identifiers, and variables between camelCase, snake_case, kebab-case, PascalCase, CONSTANT_CASE, Title Case, dot.case, and path/case.
JSON Validator
Validate JSON syntax, inspect structure, and diagnose syntax errors with line and column diagnostics.
Case-insensitive (i), multiline (m), dot-all (s), and unicode (u) via toggles, unioned with any inline flags written in /pattern/flags notation. Global matching is always on with no toggle, and other inline flags are rejected explicitly.
Each match lists its offset range, the matched text, numbered groups in order, and any named groups by name. The example pattern (foo) reports Group 1 as foo for every match.
No. This tool uses JavaScript RegExp semantics, which differ from PCRE, Python, Go, and other engines in areas like lookbehind, named groups, and Unicode handling. Always test in the engine you will ship with.
Catastrophic backtracking can make some patterns take exponentially long on innocent-looking input. Execution runs inside a worker bounded by the tool deadline, so the run fails safely instead of freezing the tab; simplify nested quantifiers to recover.
Standard JavaScript replacement tokens such as $1 for numbered groups, $& for the whole match, and $<name> for named groups. The replacement $1$1 against one foo match produces foofoo.
Keep patterns small, avoid nested unbounded quantifiers, and test against representative input with Unicode mode set as you will ship it. The worker deadline is a safety net, not a license to run adversarial patterns.