Regex Tester
Test regular expressions live with match highlighting, capture groups and replace preview.
Matches & capture groups
Replace preview
How to use it
- Type your pattern (for example
(\d{4})-(\d{2})-(\d{2})) into the pattern box. - Choose flags —
gfor global,ifor case-insensitive,mfor multiline. - Watch matches highlight live as you type in the test text.
- Open Matches & capture groups to see what each group captured per match.
- Enter a replacement to preview
String.replaceoutput.
Common use cases
- Validating input formats — phone numbers, dates, emails and slugs against a real sample set.
- Extracting parts of log lines — use capture groups to pull timestamps or error codes out of mixed text.
- Learning backreferences — build a replacement like
$1/$2and see the result instantly instead of guessing.
FAQ
Q: Which regex dialect is used?
A: The JavaScript RegExp engine (ECMAScript). It is close to PCRE for everyday patterns but differs on some advanced features — test anything ported from another language.
Q: My pattern matches in another tool but not here — why?
A: Differences usually come from flags (the g flag changes match iteration) or from engine-specific features. Check flags first, then the pattern itself.
Q: Can I test Unicode and Chinese text?
A: Yes. JavaScript regex operates on UTF-16 code units; for broad character matching use the u flag and escapes like \p{L} with a recent browser.
Used in these workflows
Your data stays on this device
Regex Tester runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.
Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.