Regex Tester
Test a regular expression against sample text and see every match, instantly in your browser.
How to use the Regex Tester
- Enter the regular expression pattern, without the surrounding slashes.
- Enter any flags, such as g for all matches or i to ignore case.
- Paste the text you want to test against.
- Click Run to see each match, the index where it starts, and any capture groups.
How the Regex Tester works
The tester builds a native JavaScript RegExp from your pattern and flags, so results are exactly what you'll get in browsers and Node.js. With the g flag it finds every match; without it, only the first.
For each match it shows the matched text, its zero-based index in the input and the values of any capture groups in parentheses. Invalid patterns, such as an unclosed group, are reported with the browser's error message. Other regex flavors, like PCRE or .NET, support some syntax JavaScript doesn't, such as possessive quantifiers.
Frequently asked questions
- Is this tool free?
- Yes. Test regular expressions at no cost, with no account required.
- What flavor of regex does this use?
- JavaScript's native RegExp engine, the same one used by browsers and Node.js.
- What do the flags mean?
- g finds all matches instead of just the first, i ignores case, m makes ^ and $ match line boundaries, s lets . match newlines, and u enables full Unicode matching.