Regex Tester
Test and debug regular expressions with real-time matching
Regular Expression
/
/g
g - Global
i - Ignore Case
m - Multiline
s - Dot All
u - Unicode
y - Sticky
Test Text
Characters: 0 | Lines: 1
Display Settings
Highlight Matches in Text
Show Statistics
Show Capture Groups
Regex Examples
Email Validation
Match valid email addresses
/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/gm
Phone Numbers
Extract phone numbers in various formats
/(?:\+?1[-.]?)?\(?([0-9]{3})\)?[-.]?([0-9]{3})[-.]?([0-9]{4})/g
URL Extraction
Find URLs in text
/https?:\/\/[^\s]+/gi
HTML Tags
Match HTML tags with named groups
/<(?<tag>\w+)(?<attrs>[^>]*)>(?<content>.*?)<\/\k<tag>>/gs
Date Formats
Match various date formats
/\b(?<month>\d{1,2})[/-](?<day>\d{1,2})[/-](?<year>\d{4})\b|\b(?<year2>\d{4})-(?<month2>\d{2})-(?<day2>\d{2})\b/g
CSS Selectors
Parse CSS class and ID selectors
/(?<selector>[.#])(?<name>[a-zA-Z][a-zA-Z0-9_-]*)/g
History