Home › Developer Tools › Regex Tester
Regex Tester
Build and debug regular expressions with instant highlighting.
- Free & unlimited
- No sign-up
- Instant results
How to use the Regex Tester
- Type your pattern and tick the flags.
- Paste the text to test against.
- See highlighted matches, groups and an optional replace preview.
Flags
- g – find all matches, not just the first
- i – ignore upper/lower case
- m – ^ and $ match at every line
- s – . also matches line breaks
- u – full Unicode support
Cheat sheet
\d digit \w letter/digit/_ \s space
. any char * 0+ + 1+ ? 0 or 1 {2,4} 2 to 4
^ start $ end [abc] one of (x) group a|b eitherSafe on slow patterns
Patterns that would freeze the browser (catastrophic backtracking) are stopped after 1.5 seconds with a warning.
Frequently asked questions
Which regex flavour is this?
JavaScript (ECMAScript), which is very close to PCRE used by PHP and most editors.
How do I use groups in the replacement?
Use $1, $2 for numbered groups, or $<name> for named groups.
Is my text uploaded?
No, matching runs in your browser.
Related tools
Find and Replace Text
Replace words or patterns across any text, with regex support.
SRT Find and Replace
Find and replace words in subtitles without touching the timings.
JSON Formatter & Validator
Format, validate and minify JSON with clear error messages.
Text Compare (Diff Checker)
Compare two texts and highlight lines that were added or removed.