🛠️

Dev Tools

Regex Tester

Test regular expressions with real-time matching and detailed analysis

Regular Expression Pattern

/

/

g

Regex Flags

Test String

Common Regex Patterns

PatternRegexDescriptionAction
Email[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}

Basic email validation

Phone\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})

US phone number

URLhttps?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)

URL validation

IPv4\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b

IPv4 address

Date (YYYY-MM-DD)\d{4}-\d{2}-\d{2}

ISO date format

Time (HH:MM)([01]?[0-9]|2[0-3]):[0-5][0-9]

24-hour time format

Hex Color#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})

Hexadecimal color codes

Credit Card\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}

Credit card number format

Regex Reference

Character Classes

. - Any character except newline

\\d - Digit [0-9]

\\w - Word character [A-Za-z0-9_]

\\s - Whitespace

Quantifiers

* - 0 or more

+ - 1 or more

? - 0 or 1

{n,m} - Between n and m

Anchors

^ - Start of line

$ - End of line

\\b - Word boundary