.*
KJ
Synthora
· Regex Tester
Ready
🔗 Share
📥 Export
🗑 Clear
/
/
Flags
g
global
i
ignoreCase
m
multiline
s
dotAll
u
unicode
Matches:
0
· Groups:
0
Test String
Email
URL
Date
Phone
Code
✕ Clear
1
Matches
Groups
Detail
Enter a pattern above to see matches
Reference
Replace
Library
Character Classes
\d
Any digit [0-9]
\D
Any non-digit
\w
Word char [a-zA-Z0-9_]
\W
Non-word character
\s
Whitespace (space, tab, newline)
\S
Non-whitespace
.
Any character except newline
[abc]
Character set — a, b, or c
[^abc]
Negated set — not a, b, or c
[a-z]
Range — lowercase a to z
Anchors
^
Start of string/line
$
End of string/line
\b
Word boundary
\B
Non-word boundary
Quantifiers
*
0 or more (greedy)
+
1 or more (greedy)
?
0 or 1 (optional)
{n}
Exactly n times
{n,m}
Between n and m times
*?
0 or more (lazy)
+?
1 or more (lazy)
Groups & Lookarounds
(abc)
Capturing group
(?:abc)
Non-capturing group
(?<name>)
Named capturing group
a|b
Alternation — a or b
(?=abc)
Positive lookahead
(?!abc)
Negative lookahead
(?<=abc)
Positive lookbehind
(?<!abc)
Negative lookbehind
Escapes
\n
Newline
\t
Tab
\r
Carriage return
\0
Null character
\.
Escaped dot (literal)
Replacement Pattern
References
$&
$1
$2
$`
$'
${
\n
Result Preview
Enter a replacement pattern above
📋 Copy Result
📥 Download
📧 Email Address
/^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$/gm
Validates standard email formats
🌐 URL / Link
/https?:\/\/[^\s/$.?#][^\s]*/gi
HTTP and HTTPS URLs
📱 Indian Phone Number
/(?:\+?91[-\s]?)?[6-9]\d{9}/g
10-digit Indian mobile numbers
📞 US Phone Number
/(\+1[-\s]?)?(\(?\d{3}\)?[-\s]?)\d{3}[-\s]?\d{4}/g
US/Canada phone number formats
🖥 IPv4 Address
/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g
IPv4 address detection
🆔 UUID / GUID
/[0-9a-fA-F]{8}-...-[0-9a-fA-F]{12}/gi
UUID v1–v5 format
✅ Strict IPv4
/\b(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.…/g
Validates 0–255 range precisely
🎨 Hex Color Code
/#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\b/g
CSS hex colors #rrggbb or #rgb
💳 Credit Card Number
/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g
16-digit card numbers
📅 4-Digit Year
/\b\d{4}\b/g
Matches 4-digit year values
📆 Date (DD/MM/YYYY)
/complex date validation/g
Validates real calendar dates with leap year
🔒 Strong Password
/(?=.*[a-z])(?=.*[A-Z])(?=.*\d)…/g
Min 8 chars, upper+lower+digit+symbol
🏷 HTML Tags
/<([a-z]+)…>/gi
Matches HTML opening/self-closing tags
💬 Code Comments
/\/\/[^\n]*|\/\*[\s\S]*?\*\//g
JS single and multi-line comments