Regex Tester
Test your regular expressions instantly. Type a pattern, pick flags, paste some sample text, and see every match highlighted with a full list of captured groups. Invalid patterns get a clear, friendly error message instead of a broken page. Perfect for debugging form validation, log parsing, and data extraction patterns – all in your browser, with nothing uploaded.
Flags:
Highlighted matches:
Matches and captured groups:
How to Use the Regex Tester
- Type your regular expression pattern (just the pattern – no surrounding slashes).
- Tick the flags you need: g to find all matches, i to ignore case, m for multiline
^/$behavior. - Paste your test text and click Test Regex.
- Matches are highlighted in the text, with the total count and every captured group listed below.
Practical example
You need a pattern that finds email addresses in customer feedback. Enter [\w.-]+@[\w.-]+\.\w+ with the g flag, paste a few sample messages, and instantly see each address highlighted. If you add a group like @([\w.-]+), the group list shows you exactly which domain each match captured – so you can refine the pattern before putting it into production code. This tight feedback loop is the fastest way to learn regex: change one character, retest, and watch the highlights move. It beats the old cycle of editing code, reloading the page, and squinting at console output.
Key features and benefits
- Live highlighting: every match is wrapped in a highlight right inside your test text.
- Group inspection: captured groups are listed per match, making complex patterns easy to debug.
- Flag toggles: global, case-insensitive, and multiline flags with one click each.
- Friendly errors: an invalid pattern shows a plain-language message instead of crashing.
- Safe by default: runaway patterns are capped so the page never freezes.
Limitations
This tester uses your browser’s JavaScript regex engine, so exotic features from other flavors (like PCRE lookbehind variations or .NET balancing groups) may behave differently here than in their native environment. It tests matching only – it does not do replacements. Extremely large texts with pathological patterns are capped at 10,000 matches to protect the page.