Regular Expression Tester

Test and validate your regular expressions in real-time. See matches, captures, and debug your patterns instantly.

Pattern
Flags
PATTERN STATUS
Enter a pattern and click Test Regex
MATCHES FOUND
0
No matches yet. Test your regex to see results.
Enter pattern and text to see highlighted matches

Regex Cheat Sheet

Regular expressions are powerful tools for pattern matching and text manipulation. Use this reference guide to build and test your patterns.

Character Classes:

[abc] - Match any single character a, b, or c
[^abc] - Match any character except a, b, c
[a-z] - Match any character from a to z
. - Match any single character
\d - Match any digit (0-9)
\w - Match word character (a-z, A-Z, 0-9, _)
\s - Match whitespace character
\b - Word boundary

Quantifiers:

* - 0 or more occurrences
+ - 1 or more occurrences
? - 0 or 1 occurrence
{n} - Exactly n occurrences
{n,m} - Between n and m occurrences

Flags:

g - Global (find all matches)
i - Case-insensitive
m - Multiline mode
s - Dotall (. matches newlines)

Common Patterns:

  • \b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b - Email address
  • ^\d{4}-\d{2}-\d{2}$ - Date (YYYY-MM-DD)
  • ^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$ - URL
  • ^\d{10}$ - Phone number (10 digits)
  • ^[A-Z]{2}\d{5}(-\d{4})?$ - ZIP code