Regex Tester
Write and test regular expressions in real-time. See all matches highlighted, extract capture groups, view match indices, and get detailed match information. Supports JavaScript regex syntax with all flags.
Regex Flags
g — global (find all matches) i — case insensitive m — multiline (^ and $ match line boundaries) s — dotAll (. matches newlines) u — unicode mode d — indices (capture group positions)
Examples
Email validation
Result: 1 match: "user@example.com" (full match)
Classic email regex matches valid email format.
Extract phone numbers
Result: 2 matches: "+919876543210", "9123456789"
Extract all phone numbers from a block of text.
Frequently Asked Questions
Which regex flavor is used?
JavaScript (ECMA-262) regex syntax is used, which is compatible with most modern languages including Python, Ruby, and Java for common patterns.
What is a capture group?
Parentheses create capture groups. For example (\d+)-(\d+) captures two numbers separated by a hyphen as groups 1 and 2.
What are lookaheads and lookbehinds?
Lookahead (?=) and lookbehind (?<=) match positions without consuming characters. For example price: (?=\d+) matches a position followed by digits.