Regex Tester & Generator
Test regular expressions with real-time matching, capture groups, and common pattern snippets
Regular Expression
//g
Test Text
Live Results
Ready to testReady to test
Enter a regex pattern and test text to see results.
Common Regex Patterns
Email Validation
Validates email addresses
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9....Example: user@example.com
Phone Number (US)
Matches US phone numbers
^\(?([0-9]{3})\)?[-. ]?([0-9]{...Example: (555) 123-4567
URL Validation
Matches HTTP/HTTPS URLs
https?:\/\/(www\.)?[-a-zA-Z0-9...Example: https://www.example.com
Extract Numbers
Extracts all numbers
\d+Example: Price: $25.99
Credit Card
Validates major credit card formats
^(?:4[0-9]{12}(?:[0-9]{3})?|5[...Example: 4532015112830366
IPv4 Address
Validates IPv4 addresses
^(?:(?:25[0-5]|2[0-4][0-9]|[01...Example: 192.168.1.1
Hex Color
Matches hex color codes
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{...Example: #FF5733
Date (YYYY-MM-DD)
Matches ISO date format
^\d{4}-\d{2}-\d{2}$Example: 2024-12-25
Regex Guide
Common Symbols
.- Any character*- Zero or more+- One or more?- Zero or one^- Start of string$- End of string
Character Classes
\d- Any digit\w- Word character\s- Whitespace[a-z]- Lowercase letters[0-9]- Numbers[^x]- Not x
Flags
g- Global (find all)i- Case insensitivem- Multilines- Dot matches newline