Regex Tester

Test regular expressions live, entirely in your browser.

Your pattern and test text are processed only in your browser. Nothing is uploaded.

This tool tests regular expressions using the JavaScript (ECMAScript RegExp) engine. Enter a pattern and flags, paste some test text, and see every match, its position, and any capture groups update live — useful for debugging and learning regex.

Enter a pattern and test string to see live results here

FAQ

What do the g and i flags mean?

g (global) finds all matches instead of just the first one; i (ignore case) makes matching case-insensitive. m (multiline) makes ^ and $ match the start/end of each line; s (dotAll) lets . also match newline characters.

What is a capture group?

Parts of a pattern wrapped in parentheses ( ) are capture groups — after a match, you can read each group's contents separately. For example (\w+)@(\w+) captures the username and domain of an email separately.

Why do I only see one match without the g flag?

This is standard JavaScript regex behavior: without the g flag, only the first match is returned. Check the g flag to see every match in the text.