Regex Tester & Debugger Tool

Test your regular expressions in real-time with instant results. Perfect for developers to validate patterns quickly.

Regex Tester
Cheat Sheet
Common Patterns
i g m s
Match Results Time: 0ms
No matches yet. Enter a regex pattern and test string to see results.
Regex Explanation
Regex explanation will appear here.

Complete Regex Cheat Sheet

Character Classes

.

Any character except newline

[abc]

Any of a, b, or c

[^abc]

Not a, b, or c

[a-z]

Character between a to z

\d

Digit (0-9)

\D

Not a digit

\w

Word character (a-z, A-Z, 0-9, _)

\W

Not a word character

\s

Whitespace (space, tab, newline)

\S

Not whitespace

Anchors & Boundaries

^

Start of string (or line in multiline)

$

End of string (or line in multiline)

\b

Word boundary

\B

Not word boundary

\A

Start of string (always)

\Z

End of string (before final newline)

\z

Absolute end of string

Quantifiers

*

0 or more (greedy)

*?

0 or more (lazy)

+

1 or more (greedy)

+?

1 or more (lazy)

?

0 or 1

{n}

Exactly n times

{n,}

n or more times

{n,m}

Between n and m times

Groups & Lookarounds

(...)

Capturing group

(?P<name>...)

Named capturing group

(?:...)

Non-capturing group

\1, \2

Backreferences to groups

(?=...)

Positive lookahead

(?!...)

Negative lookahead

(?<=...)

Positive lookbehind

(?<!...)

Negative lookbehind

Special Characters

\n

Newline

\r

Carriage return

\t

Tab

\v

Vertical tab

\f

Form feed

\0

Null character

\xHH

Character with hex code HH

\uHHHH

Unicode character

Common Patterns

^\d+$

Numeric string

^[a-zA-Z]+$

Letters only

^\w+$

Alphanumeric + underscore

^[a-zA-Z0-9]+$

Alphanumeric

^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$

Email (basic)

^https?://[^\s/$.?#].[^\s]*$

URL (basic)

^(\d{3})-\d{3}-\d{4}$

US phone number

^\d{5}(-\d{4})?$

US ZIP code

Common Regex Patterns

Click on a pattern to insert it into the regex input field.

Email Address
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
URL
^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$
Phone Number (US style)
^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$
Indian Phone Number
^[6-9]\d{9}$
ZIP Code (US)
^\d{5}(-\d{4})?$
Indian PIN Code
^[1-9][0-9]{5}$
IPv4 Address
^([0-9]{1,3}\.){3}[0-9]{1,3}$
IPv6 Address
^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$
Date (YYYY-MM-DD)
^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
Hex Color Code
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
Username (alphanumeric, min 8 chars)
^[a-zA-Z0-9]{8,}$
Strong Password
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Currency (1,234.56)
^[0-9]{1,3}(,[0-9]{3})*(\.[0-9]{2})?$
Vehicle Number (India)
^[A-Z]{2}\d{2}[A-Z]{2}\d{4}$
Aadhaar Number
^\d{4}\s\d{4}\s\d{4}$
PAN Number
^[A-Z]{5}[0-9]{4}[A-Z]$
GSTIN
^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$
IFSC Code
^[A-Z]{4}0[A-Z0-9]{6}$
UPI ID
^[\w.-]+@[\w]+$