Regex Tester
Test and debug regular expressions with live matching
Regex Tester runs your pattern against a test string and shows every match, its position, and any capture groups — so you can see exactly what a regular expression does before you put it in real code.
How to use Regex Tester
- 1
Type or paste your regular expression pattern.
- 2
Set any flags you need (g, i, m, s, u, y).
- 3
Paste the text you want to test it against.
- 4
Matches, their positions, and capture groups update as you type.
Everything you need to know about testing regular expressions
Why test a regex before using it in code?
A regular expression that looks right can still fail on edge cases — an unescaped special character, a greedy quantifier matching more than intended, or a pattern that works on your one test string but breaks on a slightly different real one. Testing against multiple sample inputs live, before it's buried in code, catches this early.
When you actually need this
- Building a validation pattern (email, phone number, custom format) and confirming it matches what it should — and rejects what it shouldn't.
- Debugging why a regex isn't matching as expected in existing code.
- Understanding a regex someone else wrote, by testing it against your own sample inputs.
Related Developer Tools
JSON Formatter
Format, validate and beautify JSON with syntax highlighting
JSON Minifier
Minify and compress JSON by removing whitespace
JSON Viewer
Interactive tree view for exploring complex JSON data
XML Formatter
Format and validate XML documents
YAML Formatter
Format, lint and validate YAML files
CSV to JSON
Convert CSV files or data to JSON format
Frequently Asked Questions
Which regex flags are supported?
g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode) and y (sticky) — the standard JavaScript regex flags.
Why would a pattern time out instead of matching?
Some patterns (nested quantifiers like (a+)+ against certain input) can trigger catastrophic backtracking, where matching time explodes exponentially. Matches are run with a 1-second limit so a runaway pattern fails fast with a clear message instead of hanging.
Does this tool send my pattern and text to a server?
Yes — both are sent to our servers to run the match and the result is returned to you; we don't store them.
Can I test capture groups?
Yes — each match shows its full text, its index in the string, and the text captured by every group in the pattern.
Is this tool free to use?
Yes — completely free, with no signup and no usage limits for casual use.