Regular Expression Tester

Test and validate regular expressions with real-time matching, highlighting, and detailed analysis.

Settings

Configure your regex pattern and test settings

/pattern/g

Regex Flags

Find all matches

Case insensitive

^ and $ match line breaks

Length: 0 characters

⚡ Sample Test Strings

Click to try these test strings

💡 Regex Tips

  • Use \d for digits, \w for word characters
  • + means one or more, * means zero or more
  • Use ^ for start, $ for end of string
  • Escape special characters with \
  • Use parentheses () for capture groups

Test Results

No matches found

No test string provided

Enter a test string above to see regex matches and highlighting

Common Patterns (10)

Click on any pattern to load it into the tester

validation
Email Address
/no flags
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
validation
URL/Website
/i
^(https?://)?(www\.)?[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(/.*)?$
Example: https://www.example.com
validation
Phone Number (International)
/no flags
^\+?[1-9]\d{1,14}$
Example: +1234567890
validation
Strong Password
/no flags
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Example: MyPass123!
validation
Hex Color
/no flags
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
Example: #FF5733 or #F73
validation
Date (YYYY-MM-DD)
/no flags
^\d{4}-\d{2}-\d{2}$
Example: 2024-12-25
extraction
Extract Words
/g
\b\w+\b
Example: Extract all words from text
extraction
Extract Numbers
/g
\d+
Example: Find all numbers in text
extraction
Find Acronyms
/g
\b[A-Z]{2,}\b
Example: USA, API, HTML
formatting
Duplicate Words
/gi
(\w+)\s+\1
Example: the the quick brown

Regex Quick Reference

Character Classes

.Any character
\dDigit (0-9)
\wWord character
\sWhitespace
[abc]Character set
[^abc]Negated set

Quantifiers

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