Regex Tester
Test and debug regular expressions with live match highlighting.
Last updated:
About the Regex Tester
Writing a regular expression is a loop of guessing and checking, and this shortens the loop by running your pattern against sample text as you type, highlighting each match. Because it uses the browser's own regular expression engine, what matches here is what will match in your JavaScript — there is no dialect gap between the sandbox and the code. It suits validating an input format, pulling fields out of log lines, or working out why a pattern that looked right catches one case too many. Two things to keep in mind. This is JavaScript regex syntax, and PCRE, Python and .NET differ in places, particularly around lookbehind and named groups. And deeply nested quantifiers on long input can backtrack catastrophically and hang the tab; if typing a pattern freezes the page, that behaviour, not a crash, is usually the explanation.
How to use it
- Enter a pattern and set any flags you need, such as g for all matches or i for case-insensitive.
- Paste sample text underneath.
- Watch matches highlight, and adjust until only what you intend is caught.
Things worth knowing
- This is JavaScript regex syntax. PCRE, Python and .NET differ in places — lookbehind and named group support in particular.
- An invalid pattern simply reports an error rather than matching nothing silently.
- Deeply nested quantifiers on long inputs can backtrack catastrophically and hang the tab. If typing a pattern freezes the page, that is usually why.