Regular Expression Tester
Test a JavaScript regex live: highlighted matches, captured groups, flags, replacement.
//gi
2 correspondances
Contact john.doe@example.com or mary@site.org before 12/03/2026. Phone: 06 12 34 56 78 — postal code 75011.
JavaScript (ECMAScript) syntax: the same as in browsers and Node.js. Expressions run locally; a very expensive expression can slow down the tab.
Processed in your browserFree
Related tools
- Compare Two TextsHighlight the differences between two texts, by lines, words or characters.
- Clean Up TextRemove extra spaces, blank lines and duplicates, rejoin lines broken by a PDF, sort lines.
- JSON Formatter and ValidatorIndent, validate (with the line and column of the error), minify or convert JSON to CSV.
- Convert CSV to JSONTurn a CSV file (separator detected automatically) into a JSON array of objects.
About this tool
Write or paste a regular expression and immediately see what it captures in your text: highlighted matches, a table of groups (numbered and named), g, i, m, s, u flags, clear error messages and a replacement field with $1, $2 or $<name>. Ready-made patterns (email, URL, phone, date, IBAN) serve as a starting point.
How to use this tool
- 1Enter the expression and tick the flags.
- 2Paste the test text: matches are highlighted.
- 3Add a replacement to see the transformed text.
Limits to know
- JavaScript (ECMAScript) syntax: a few differences from PCRE/Python (no variable-length lookbehind in older browsers, no \A).
- A very expensive expression (catastrophic backtracking) can freeze the tab for a moment.
- Display is limited to 2,000 matches.
- Accepted formats
- Text
- Maximum size
- 2 MB
Privacy and file processing
Data is processed in your browser and is never sent to a server.
Read our privacy policyFrequently asked questions
Not always: the syntax is JavaScript's (ECMAScript). A few differences: no \A or \Z, limited lookbehind in older browsers, different flags. Test the edge cases.
Nested quantifiers (for example (a+)+) cause catastrophic backtracking. Simplify the expression or limit the input; the display is capped at 2,000 matches anyway.
