Build and test regular expressions with live match highlighting and capture-group analysis.
Email
Standard email address
/[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/gi
URL
HTTP / HTTPS URL
/https?:\/\/[^\s/$.?#].[^\s]*/gi
Phone (US)
US phone number in common formats
/(?:\+1[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}/g
Hex Color
3 or 6 digit hex color code
/#(?:[0-9a-fA-F]{3}){1,2}\b/g
IPv4 Address
Valid IPv4 address
/(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)/g
Date (YYYY-MM-DD)
ISO 8601 date format
/\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])/g
HTML Tag
Simple HTML element (not nested)
/<([a-z][a-z0-9]*)(?:\s[^>]*)?>.*?<\/\1>/gis
Slug
URL-safe slug
/[a-z0-9]+(?:-[a-z0-9]+)*/g
UUID v4
UUID version 4
/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/gi
JWT
JSON Web Token
/eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g
alice@example.com
alice
example
com
bob@work.io
bob
work
io
carol@company.org
carol
company
org