Regex Tester
This regex tester runs a JavaScript regular expression with your chosen flags against sample text of up to 5,000 characters and highlights every match as you type.
About this tool
This regex tester runs a JavaScript regular expression with your chosen flags against sample text of up to 5,000 characters and highlights every match as you type.
How to use it
- Enter your pattern between the slashes.
- Add flags such as g, i or m.
- Type or paste the test string (up to 5,000 characters).
- Review the highlighted matches below.
Good to know
- Patterns use the browser's JavaScript RegExp engine, so syntax matches what your JS code will do.
- Common flags: g (find all matches), i (ignore case), m (^ and $ match at line breaks), s (dot matches newlines), u (Unicode).
- A 500 ms timeout stops runaway patterns that cause catastrophic backtracking (ReDoS).
- Zero-length matches are handled so patterns like ^ or \b cannot loop forever.
Runs entirely in your browser — nothing you enter is uploaded or stored.
Frequently asked questions
Which regex flavour does this use?
JavaScript (ECMAScript). Most syntax is shared with PCRE and Python, but some features such as possessive quantifiers are not supported.
Why does my regex only match once?
Without the g flag, a regex stops at the first match. Add g to find every match.
What is catastrophic backtracking?
Some patterns, such as (a+)+b, take exponential time on certain inputs. The tester stops after 500 ms instead of freezing your browser.
Is my text or pattern sent anywhere?
No. Matching runs entirely in your browser.