Regex Tester
Test ECMAScript regular expressions, inspect matches and captures, and try replacements in your browser.
Enter “Pattern”, “Flags” and test text, then use “Test”. Enter “Replacement” to inspect the replacement output. Method and limits
Matches
Elapsed (ms):
Matches:
- UTF-16 index:
Captures:
Regex reference
Method and limits
Method and limits
ECMAScript RegExp runs only in a disposable worker. Supported browser flags are dgimsuvy; duplicate flags and u with v are invalid. Indices count UTF-16 code units; u/v zero-width progress advances a Unicode code point. Unmatched captures differ from empty captures. Global matching collects at most 5000 matches; a further match marks the preview incomplete and disables replacement. Replacement is built once from complete matches, supports $$, $&, $1–$99, named groups, prefix and suffix tokens, and allows an empty result. No match preserves the original text. Presets are learning heuristics, not full email, URL, IPv4 or HTML validators. This is not PCRE or RE2.
Tool input is processed locally in a worker, without uploads, storage or source logging. Ads and the rest of the site may make network requests. Assets must load first; offline operation is not guaranteed.
Text 200000 UTF-16 units; pattern/replacement 10000 each; 5000 matches; message/output 2 MiB UTF-8. Startup 5 s, matching plus replacement 1 s.
Copied
Copy failed. Select the result and copy it manually.
Popular Tools
About Regex Tester
Test ECMAScript regular expressions, inspect matches and captures, and try replacements in your browser.
(cat), g; cat dog cat → X dog X; 0, 8
Versioned technical method; no calendar or legal reference year applies.
Use Cases
How to use
Enter your regex pattern
Enter “Pattern”, “Flags” and test text, then use “Test”. Enter “Replacement” to inspect the replacement output.
Paste test text below
Inspect “Matches”, “Captures” and “UTF-16 index”; “Copy” copies the replacement output.
Use “Clear” to empty the draft and result; “Cancel” stops current work.
Pro Tips
- Use flags: g (global), i (case-insensitive), m (multiline)
- Test with edge cases
- Start simple and build complexity
- Review warnings and the output before copying. A successful transform is not proof of compatibility with your application.
Frequently Asked Questions
Regular Expression - a pattern language for matching text.
Check flags, escaping special characters, and pattern logic.
Parentheses () capture part of the match for extraction.
ECMAScript RegExp runs only in a disposable worker. Supported browser flags are dgimsuvy; duplicate flags and u with v are invalid. Indices count UTF-16 code units; u/v zero-width progress advances a Unicode code point. Unmatched captures differ from empty captures. Global matching collects at most 5000 matches; a further match marks the preview incomplete and disables replacement.
Replacement is built once from complete matches, supports $$, $&, $1–$99, named groups, prefix and suffix tokens, and allows an empty result. No match preserves the original text. Presets are learning heuristics, not full email, URL, IPv4 or HTML validators. This is not PCRE or RE2.