How to use
Enter the pattern (the part between the slashes, e.g. \d{3}-\d{4}) and toggle flags such as g, i and m.
Paste the text to search into “Test string”. Matches are highlighted in place, and the panel on the right lists each match’s index, length and groups.
To replace, switch to “Replace” and enter a replacement using $1 or $<name>; the output shows exactly what changed.
For validation patterns, use “Test cases”: list values that should and should not match, one per line, and see pass/fail for all of them.
Copy the finished pattern as a “JS literal” or as “new RegExp()” and paste it into your code.
What it does
Live in-place highlighting
Matches are painted directly on the test string as you type. Adjacent matches alternate colours and zero-width matches show as a thin bar, so you see exactly where — and how often — the pattern hits. Pick a match in the list to select it in the text.
Numbered and named groups
Every match lists $1, $2… and named groups (?<name>…) with their values and positions. Groups that did not participate and empty strings are shown distinctly, which makes backreferences and replacements easy to build.
Replace preview with a change list
$1, $<name>, $&, $` and $' are expanded exactly as the JavaScript spec defines, and the output highlights what changed. A before → after list is included; copy or save the result.
Pass/fail test cases
Check a validation regex against “should match” and “should not match” lists in one go. Optionally require a whole-line match (wrapping in ^…$); a bar shows how many cases pass.
Pattern explained in plain language
Our own parser explains quantifiers, character classes, lookarounds, backreferences and Unicode properties one token at a time. Syntax errors point to the exact character and suggest a fix.
Built not to freeze your browser
Matching runs in a Web Worker and is terminated after one second. Classic catastrophic-backtracking shapes like (a+)+ are flagged up front with tips to fix them.
Use cases
- Validate a form-validation regex (email, postal code, phone number) against good and bad examples
- See how many matches a pattern finds in logs or CSV — and where — before extracting data
- Preview a $1 / $<name> search-and-replace before running it in your editor or script
- Decode a complex regex written by someone else, piece by piece
- Safely reproduce whether a production hang was caused by a regex (ReDoS)
Supported formats
Syntax
Copy as
Capability matrix
| Feature | Support | Notes |
|---|---|---|
| Match highlighting, positions & groups | Supported | Up to 10,000 matches listed; first 2,000 highlighted |
| Replace preview ($1, $<name>, $& …) | Supported | Identical to String.prototype.replace |
| Split and multi-line pass/fail testing | Supported | — |
| Pattern explanation & error position | Partial | Common syntax covered; v-flag set operations are shown as raw items |
| Catastrophic backtracking detection | Partial | 1-second hard stop plus warnings for classic shapes; not every dangerous pattern can be predicted |
| PCRE, Python, Java or .NET regex flavours | Not supported | Runs on the JavaScript engine; (?i), \A, possessive quantifiers etc. behave differently |
| Saving patterns or share links | Not supported | Nothing you type is stored anywhere |
| Offline use | Supported | Works without a connection once loaded |
Limits & notes
- Test strings up to 1,000,000 characters; patterns up to 10,000 characters.
- Up to 10,000 matches are counted and listed; the rest are cut off (replacement output is still computed in full).
- Above 200,000 characters, in-place highlighting is turned off and only the list is shown.
- Any single run longer than one second is stopped. Split very large inputs if a legitimate pattern is slow.
- Available flags and syntax depend on your browser’s JavaScript engine (the v flag needs a recent browser).
Privacy & safety
Your pattern and test text are processed only inside your browser. Nothing is uploaded or stored, and analytics never include what you type — so it is safe to test against logs or customer data.
FAQ
How do I match Japanese or other non-Latin text?
Is there a perfect email regex?
What is ReDoS / catastrophic backtracking?
What is the difference between $1 and $<name> in a replacement?
What happens without the g flag?
Can I test Python or PHP regular expressions?
Related tools
Diff Tool — Text & Code Compare
Paste or drop two versions and see added and removed lines, plus the exact words that changed inside each line. Copy or save the result as a unified patch. Nothing leaves your browser.
UUID / ULID / NanoID / Token Generator
A UUID is ready the moment the page opens. Switch to UUID v7, ULID, NanoID or a random token, generate up to 10,000 at once and save them as .txt, .csv or .json. Paste an existing UUID or ULID to read its embedded time and version.
Code Formatter — Format & Minify
Paste code to format it with the language auto-detected. Choose indent, line width, semicolons, quotes and trailing commas; JavaScript, CSS and HTML can also be minified with before/after size and reduction. Your code never leaves the browser.
JSON Studio — Formatter & Validator
Paste JSON to format, minify or validate it instantly. Errors are shown with the exact line, column and cause, and comments or trailing commas can be auto-repaired. Your data never leaves your device.
XML Studio — Formatter & Validator
Paste XML to format, minify or validate it. Errors show the exact line, column and cause, and whitespace that carries meaning (mixed content, xml:space) is never touched. XPath search and JSON conversion are on the same screen. Your data never leaves your device.
YAML / TOML Studio — Validate, Format & Convert
Paste YAML, TOML or JSON to validate, format or convert it. Errors show the exact line and column, and type traps such as “no becomes false” and anything lost in conversion are flagged up front. Your data never leaves your device.
Last updated: