Regex Tester

Test regular expressions with live matching

Input
Output

    
  

About Regex Tester

Regular expressions (regex) are patterns used to match, search, and manipulate text. This tool lets you test regex patterns against sample text with live highlighting of matches. It supports JavaScript regex syntax including capture groups, lookaheads, and all standard flags (g, i, m, s, u, y).

Q: What regex syntax is supported?
This tool uses JavaScript's native RegExp engine. It supports all ECMAScript regex features including named capture groups, lookbehind assertions, and Unicode property escapes.
Q: What do the flags mean?
g (global) finds all matches. i (case-insensitive) ignores case. m (multiline) makes ^ and $ match line boundaries. s (dotAll) makes . match newlines.
Q: Why does my regex work here but not in my code?
Different programming languages have different regex engines. This tool uses JavaScript's regex, which may differ from Python, Java, or PCRE. Check your language's documentation for syntax differences.
Q: What are capture groups?
Parentheses () in a pattern create capture groups that extract specific parts of a match. For example, (\d{4})-(\d{2}) captures year and month separately. Groups are shown in the output below matches.