Regex Tester

Test regular expressions in real-time with match highlighting, capture groups, and a quick reference cheat sheet.

/ /
Quick patterns:
0 matches
0 groups
gm flags

Match Details

Enter a regex pattern and test string to see matches

Ad Space

Regex Quick Reference

.Any character except newline
\dDigit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word character
\sWhitespace
\bWord boundary
^Start of string/line
$End of string/line
*0 or more
+1 or more
?0 or 1 (optional)
{n,m}Between n and m times
[abc]Character class
[^abc]Negated class
(abc)Capture group
(?:abc)Non-capturing group
a|bAlternation (or)
(?=abc)Positive lookahead
(?!abc)Negative lookahead

Free Online Regex Tester

Test and debug your regular expressions in real-time with this interactive regex tester. As you type your pattern and test string, matches are highlighted instantly with capture group details. Supports all JavaScript regex flags and includes a quick reference of common patterns and syntax.

Features

Real-time match highlighting as you type. Full match details including index positions and capture group values. Toggle regex flags (global, case-insensitive, multiline, dotAll) with single clicks. Quick-insert common patterns for emails, URLs, IP addresses, phone numbers, dates, and hex colors. Comprehensive regex syntax cheat sheet built right into the page.

Frequently Asked Questions

Which regex flavor does this use?

This tool uses JavaScript's native RegExp engine, which supports most standard regex features including lookaheads, lookbehinds (in modern browsers), character classes, quantifiers, and Unicode properties. If you need PCRE (PHP/Python) or .NET-specific features, the syntax may differ slightly.

What do the flags mean?

g (global) finds all matches, not just the first. i (case-insensitive) ignores upper/lowercase differences. m (multiline) makes ^ and $ match line boundaries, not just string boundaries. s (dotAll) makes . match newline characters as well.