Validate a regular expression with live feedback
A regex can be syntactically broken or simply not match what you intended. This validator checks that your pattern is well-formed and tests it against sample text, highlighting matches as you refine it. Seeing the matches in real time is the quickest way to confirm a pattern does exactly what you need before you rely on it in code.
How to use it
- Enter your pattern and flags.
- Paste sample text to test against.
- Watch matches highlight, and adjust until it's correct.
Tips
- Test against both text that should match and text that shouldn't.
- Use anchors to pin a match to the start or end of a line.
- Keep patterns as simple as the job allows — they're easier to maintain.
Questions people ask
Why does my pattern match too much? Quantifiers are greedy by default; add a ? to make them match as little as possible.
Is my text uploaded? No — validation runs locally in your browser.