Regex tester
Write a regular expression and see every match highlighted in your text as you type. The tester lists each match with its position and capture groups, including named groups, and supports the g, i, m, s and u flags. Turn on replace to preview substitutions with $1 or $<name> references. Patterns run in a separate background worker with a time limit, so even a catastrophic backtracking mistake cannot freeze the page.
How to use the Regex Tester
- 1
Enter a pattern
Type the expression between the slashes, without the slashes themselves.
- 2
Choose flags
Tick global to find all matches, ignore case, multiline, dot-all or Unicode as needed.
- 3
Add test text
Paste the text to search. Matches are highlighted and listed with their groups.
- 4
Try a replacement
Turn on replace and enter the replacement, using $1, $2 or $<name> for groups.
How the tester works
Patterns use your browser's JavaScript (ECMAScript) regex engine, the same one used by Node.js and web apps, so results match what your code will do. Other engines such as PCRE, Python or Java differ in some features.
Without the g flag only the first match is found. Empty matches advance by one character (or one code point with u) so the search always finishes. Matching runs in a Web Worker and is stopped after 1.5 seconds.
- \d{4}-\d{2}-\d{2} matches 2026-11-19
- (?<year>\d{4}) → named group $<year>
- replace "(\w+) (\w+)" with "$2, $1"
When to use it
- Build and debug validation patterns for emails, phone numbers or IDs.
- Extract dates, codes or amounts from logs and documents.
- Preview a search-and-replace before running it on real files.
Limits
- Uses JavaScript regex syntax; lookbehind and some flags differ from other languages.
- Lists the first 1,000 matches and shows 200 in the table.
Privacy
Your pattern and text are processed only in your browser and never sent anywhere.
Frequently asked questions
Which regex flavour is this?
JavaScript (ECMAScript), as used in browsers and Node.js. Most common syntax works the same in other languages, but check advanced features.
Why does my pattern only find one match?
Turn on the global (g) flag to find every match instead of only the first.
What is catastrophic backtracking?
Some patterns, such as (a+)+$, take exponentially longer on certain text. The tester stops them after 1.5 seconds instead of freezing your browser; rewrite the pattern to avoid nested repetition.
How do I match Sinhala or Tamil text?
Use Unicode ranges, such as [\u0D80-\u0DFF]+ for Sinhala or [\u0B80-\u0BFF]+ for Tamil, or \p{Script=Sinhala} with the u flag.
How do I use groups in the replacement?
Use $1, $2 and so on for numbered groups, $<name> for named groups and $& for the whole match.
Do I need to escape the slashes?
No. Enter the pattern without the surrounding slashes; flags are chosen with the checkboxes.
Related tools
People also use
- JWT Generator & SignerCreate and sign JSON Web Tokens with HMAC, RSA or ECDSA keys, entirely in your browser.
- Base64 Encoder & DecoderEncode and decode Base64 and Base64url, text or files.
- CSV to JSON ConverterConvert CSV ⇄ JSON with correct quoting, types and nested data.
- UUID GeneratorBulk UUID v4 and v7 generator with a UUID inspector.
Last updated November 19, 2026 · How we build and test our tools