Regex Tester
Test regex patterns against sample text with live matches, captures, flags, and error handling.
3
global scan
warning
captures: warning
error
captures: error
WARNING
captures: WARNING
About the regex tester
How this tool works
Regex work is much easier when the pattern, flags, input text, and match results are visible together. This page is built around that tight feedback loop.
Instead of just telling you that a pattern matched, it also shows positions and captures so debugging feels more concrete.
Where it is useful
It is useful for data cleanup rules, validation experiments, parser prototypes, and quick JavaScript-style regex checks.
Because the widget is registry-driven, future structured dev tools can reuse the same interactive page path instead of branching into one-off routes.
- Test validation and extraction patterns against pasted sample text.
- Debug captures and flags before moving a regex into application code.
- Check whether a pattern behaves globally or only on the first match.
Example workflows
3 examples\b(error|warning)\b with gi
Matches every error or warning token
^[A-Z]{3}-\d+$
Checks whether a value matches a strict code format
(?<tag>#[a-z]+)
Shows captures for hashtag-style matches
Common uses
3 ideas- Test validation and extraction patterns against pasted sample text.
- Debug captures and flags before moving a regex into application code.
- Check whether a pattern behaves globally or only on the first match.
FAQ
3 answersWhat does the regex tester show me?
It applies the pattern and flags directly in the browser, then shows the matched text, position, and captured groups for each result.
Does the regex tester handle malformed expressions?
Yes. Invalid patterns or unsupported flags surface a clear error message instead of failing silently.
Why do the results change when I add the global flag?
The global flag finds every match in the sample text. Without it, the tool reports only the first match, which mirrors standard JavaScript regex behavior.