Regex Tester
Regex Tester · Pattern Library · Code Snippets
Presets / Pattern Library
Email
Detect common email formats.
[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}
URL
Find HTTP/HTTPS URLs.
https?://[^\s]+
Phone
Phone pattern with optional country code.
\+?\d{1,3}?[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}
Date (YYYY-MM-DD)
Quick ISO date validation.
\b\d{4}-\d{2}-\d{2}\b
IPv4
Extract IPv4 addresses.
\b(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)\b
Hex Color
#RGB / #RRGGBB color codes.
#(?:[0-9a-fA-F]{3}){1,2}\b
Match Results
Code Snippet
Test regular expressions against input text and review matches. Generate code snippets and start from presets.
Regex Guide
Anchors
^ matches start, $ matches end.
^hello$, \bword\b
Character Classes
\\d digits, \\w word chars, \\s whitespace.
[A-Za-z0-9_], [^\s]
Quantifiers
* 0+, + 1+, ? 0/1, {n,m} range.
\d+, [A-Z]{2,4}, .*?
Groups/Captures
(...) capture, (?:...) non-capture.
(\w+)-(\d+)
Advertisement