Developer

Regex Tester

How to use

Test regular expressions and see matches instantly

Enter a regular expression pattern and test it against sample text. See which parts match, get detailed match information, and understand your regex pattern better.

Perfect for validating patterns, learning regex, and debugging complex expressions.

Results

No matches

Enter pattern and text

Syntax Reference

Reference updates based on selected method. Note: Patterns run as JavaScript; some features may differ from native implementations.

Character Classes

.
Any character except newline
\\d
Digit (0-9)
\\w
Word character (a-z, A-Z, 0-9, _)
\\s
Whitespace
[abc]
a, b, or c

Groups & Flags

(abc)
Capturing group
(?:abc)
Non-capturing group
(?<name>...)
Named group
g, i, m, s, u, y
Flags: Global, ignore case, multiline, dotAll, unicode, sticky

Quantifiers

*
0 or more
+
1 or more
?
0 or 1
{n,m}
Between n and m times

Anchors & Assertions

^
Start of line/string
$
End of line/string
\\b
Word boundary
|
OR - alternation

Character Classes

.
Any character except newline (unless DOTALL)
\\d
Digit (0-9)
\\w
Word character (a-z, A-Z, 0-9, _)
\\s
Whitespace
[abc]
a, b, or c

Named Groups (Python)

(?P<name>...)
Named group (Python syntax)
(?P=name)
Backreference to named group
(?:abc)
Non-capturing group
(abc)
Capturing group

Quantifiers

*
0 or more
+
1 or more
?
0 or 1
{n,m}
Between n and m times

Flags (re.CONSTANT)

re.I, re.IGNORECASE
Case-insensitive matching
re.M, re.MULTILINE
^ and $ per line
re.S, re.DOTALL
Dot matches newline
re.X, re.VERBOSE
Ignore whitespace/comments

Character Classes

.
Any character except newline (unless /s)
\\d
Digit (0-9)
\\w
Word character
\\s
Whitespace
\\h, \\v
Horizontal/vertical whitespace

Named Groups & Advanced

(?<name>...)
Named group
(?<=...)
Positive lookbehind
(?<!...)
Negative lookbehind
(?>...)
Atomic group

Quantifiers

*
0 or more (greedy)
+
1 or more (greedy)
*?, +?
Non-greedy versions
{n,m}
Between n and m times

Flags (modifiers)

i, m, s, x
Case-insensitive, multiline, dotAll, extended
U
Ungreedy (inverts quantifiers)
A, D
Anchors at start/end only

Character Classes

.
Any character except newline (unless /s)
\\d
Digit (0-9)
\\w
Word character
\\s
Whitespace
\\p{L}
Unicode letters (if /u flag)

Named Groups (Perl Syntax)

(?P<name>...)
Named group (Perl-compatible)
(?<=...)
Positive lookbehind
(?<!...)
Negative lookbehind
(?:abc)
Non-capturing group

Quantifiers

*
0 or more
+
1 or more
?
0 or 1
{n,m}
Between n and m times

Flags (PCRE modifiers)

i, m, s, x
Case-insensitive, multiline, dotAll, extended
u
Unicode support
A, D, U
Anchors, end-of-string, ungreedy