Regular Expression Tester
Write a regular expression, set its flags, and test it against text in real time. See every match, its capture groups, and visual highlighting directly on the text.
How it works
- Type your regular expression into the pattern field (without the delimiting slashes).
- Turn on the flags you need: g (global), i (case-insensitive), m (multiline), s, u, or y.
- Paste your test text into the corresponding panel.
- The tool runs the regular expression instantly and highlights every match directly on the text.
- Check the match table for each result's position and capture groups.
Use cases
- Validate form patterns (emails, phone numbers, postal codes) before implementing them.
- Debug complex regular expressions used in validation or text processing.
- Extract specific data from text using capture groups.
- Learn and experiment with regular expression syntax visually.
Use cases
- Validate form patterns (emails, phone numbers, postal codes) before implementing them.
- Debug complex regular expressions used in validation or text processing.
- Extract specific data from text using capture groups.
- Learn and experiment with regular expression syntax visually.
Common mistakes
- Forgetting the 'g' flag and assuming there are no more matches in the text.Without 'g', JavaScript's engine stops at the first match. Turn on the global flag to see every occurrence.
- Using . and expecting it to also match line breaks.By default, a dot doesn't match \n. Turn on the 's' flag (dotAll) if you need it to match line breaks too.
- Writing an overly 'greedy' pattern and getting longer matches than expected.Swap quantifiers like * or + for their lazy version (*? or +?) so the engine stops at the first possible match.
Frequently asked questions
The tool catches the error when building the expression and shows the exact message explaining what's wrong, instead of failing silently.
Without the 'g' (global) flag, the tool only shows the first match found. With 'g' enabled, it searches for and shows every match in the full text.
Each match in the results table includes its numbered capture groups. If an optional group didn't participate in the match, it's shown as empty (∅).
No. The pattern and test text are processed entirely in your browser using JavaScript's native regular expression engine. Nothing is sent to an external server.
Alternatives
Sites like regex101 offer token-by-token explanations of a pattern, useful for learning. This tool prioritizes quickly testing against your own text, with visual highlighting and capture groups, without leaving Ulvixor.