Regex Tester

Test, debug, and understand regular expressions with real-time matching, visual breakdowns, and code generation for multiple languages.

Regular Expression

✓ Valid ✗ Invalid
/ /
Error:

Test String

matches

Replace With

Use $1, $2, etc. for capture groups, $& for full match

Pattern Builder

Match Results

Match Details:

Split Results:

Replace Result:

Pattern Explanation

Code Generation

Performance

Execution time:
Pattern length:
Test string length:
Capture groups:

Character Classes

. - Any character except newline
\d - Digit (0-9)
\D - Not a digit
\w - Word character (a-z, A-Z, 0-9, _)
\W - Not a word character
\s - Whitespace
\S - Not whitespace
[abc] - Any of a, b, or c
[^abc] - Not a, b, or c
[a-z] - Character range

Quantifiers

* - 0 or more
+ - 1 or more
? - 0 or 1
{3} - Exactly 3
{3,} - 3 or more
{3,5} - 3 to 5
*? - 0 or more (lazy)
+? - 1 or more (lazy)

Anchors & Boundaries

^ - Start of string/line
$ - End of string/line
\b - Word boundary
\B - Not word boundary
\A - Start of string
\Z - End of string

Groups & Lookaround

(abc) - Capture group
(?:abc) - Non-capture group
(?<name>abc) - Named group
(?=abc) - Positive lookahead
(?!abc) - Negative lookahead
(?<=abc) - Positive lookbehind
(?<!abc) - Negative lookbehind

Special Characters

\n - Newline
\r - Carriage return
\t - Tab
\\ - Backslash
\. - Literal dot
\* - Literal asterisk

Flags

g - Global (all matches)
i - Case insensitive
m - Multiline mode
s - Dotall (. matches newlines)
u - Unicode support
y - Sticky mode

We use cookies to improve your experience. Learn more