Regex Tester
Test regular expressions online for free — matches are highlighted live as you type, with every capture and named group listed, a replace preview using $1 and $<name>, all JavaScript flags (g, i, m, s, u, y, d, v), common examples for emails, URLs, dates and colours, and ready-to-paste JavaScript, Python and PHP code.
100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.
Uses your browser’s JavaScript regex engine (flags g, i, m, s, u, y, d and v; named groups and lookbehind supported). Python and PHP snippets are provided as a starting point — a few features differ between engines. Your text never leaves your device.
How to test a regular expression
- Type your regular expression and flags.
- Paste the text to test against.
- See highlighted matches and the groups for each.
- Try a replacement, then copy the code for your language.
What you can use it for
- Debug patterns for form validation
- Extract emails, URLs, dates and IDs from text
- Write find-and-replace patterns for editors and scripts
- Learn regex with instant feedback
More free tools
Building for the web?
Format, minify, convert and generate code with our free, private developer tools.
See all free tools →Frequently asked questions
Which regex flavour does it use?
Your browser's JavaScript engine — which supports named groups, lookbehind and Unicode property escapes. Python and PHP snippets are generated too; a few advanced features differ between engines.
What do the flags mean?
g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match new lines, u enables full Unicode, y is sticky, d adds match indices, v enables Unicode sets.
How do I use groups in the replacement?
Use $1, $2… for numbered groups, $<name> for named groups and $& for the whole match.
Is my text uploaded?
No. Matching runs in your browser.