The Regex Tester lets you build and test regular expressions against sample text and see the results instantly. Type a pattern, choose your flags, and enter a test string — matches are highlighted as you type, with a list of every match and its capture groups.
It runs entirely in your browser using the same regular-expression engine as JavaScript, so what you see here behaves the same in your code.
How to test a regular expression
- Type your pattern between the slashes.
- Toggle the flags you need — g (global), i (ignore case), m (multiline), s (dotall), u (unicode).
- Enter or paste the text to test against.
- See matches highlighted, with match indexes and capture groups listed below.
Understanding the flags
- g (global) finds all matches instead of stopping at the first.
- i (ignore case) makes the match case-insensitive.
- m (multiline) makes ^ and $ match the start and end of each line.
- s (dotall) lets the dot (.) match newlines too.
Capture groups
Parentheses in a pattern create capture groups, letting you extract parts of a match. For example, (\w+)@(\w+) captures the text before and after the @ separately. This tester lists the captured groups for every match so you can confirm your pattern grabs the right pieces.
Because it uses the JavaScript regex engine, the syntax and behaviour match what you’ll get in Node.js and browser code.
Frequently Asked Questions
Which regex flavour does this use?
It uses the JavaScript (ECMAScript) regular-expression engine, so results match what you’d get in JavaScript and TypeScript.
Does it show capture groups?
Yes. For each match it lists the full match, its position, and any capture groups so you can verify your pattern.
Why isn’t my pattern matching?
Check your flags (especially g and i) and remember to escape special characters like . and ? with a backslash when you mean them literally.
Is my test text sent anywhere?
No. Everything runs in your browser and nothing is uploaded.