Regex Tester

Test JavaScript regular expressions with live match highlighting and a full match breakdown.

🔒 All processing happens in your browser

Need patterns to start with? Read: Regex Cheat Sheet

Need to match without consuming characters? Read: Lookahead and Lookbehind Explained

//
 
0 matches

No matches yet — enter a pattern and some text.

How it works

This tester highlights every match live as you type, using JavaScript's native regex engine — the same one your code will actually run against — so there's no gap between what you test here and what ships.

When you’d use this

  • Building or debugging a validation pattern (email, URL, phone number) before adding it to code
  • Checking whether the g, i, or m flags change which parts of a text a pattern matches
  • Extracting or testing capture groups against real sample text before writing extraction logic

Common questions

What regex flavor does this tool use?+

JavaScript's native regex engine, since everything runs in your browser. Most patterns behave the same across languages, but some advanced features (like certain lookbehind support, or Python-specific syntax) can differ slightly from PCRE, Python, or .NET regex.

What do the g, i, and m flags do?+

g (global) finds all matches instead of stopping at the first one. i (case-insensitive) treats uppercase and lowercase as equivalent. m (multiline) makes ^ and $ match the start/end of each line instead of the whole string.

Why does my pattern match nothing even though it looks right?+

The most common cause is forgetting the g flag when you expect multiple matches, or a special character (like . or *) that needs escaping with a backslash to be treated literally instead of as regex syntax.

What are 'groups' in the match results?+

Capture groups are the parts of your pattern wrapped in parentheses (). They let you extract specific pieces of a match rather than the whole thing — for example, capturing just the domain from an email match instead of the full address.

Is my test text sent anywhere?+

No — pattern matching runs entirely in your browser's JavaScript engine. Nothing you type is transmitted or stored.