What is Regular Expressions?
Regular expressions (regex) are patterns used to match character combinations in strings.
Test regular expressions against sample text with Match, Test, and Replace modes, including named groups and $1 references — entirely in your browser.
Regular expressions (regex) are patterns used to match character combinations in strings.
Enter a regex pattern and optional flags, then choose a mode: 'Match' lists all matches with their index, positional groups and named groups; 'Test' returns whether the pattern exists; 'Replace' applies the replacement text (supports $1, $&, and named-group references) and shows the replaced result. Use the 'g' flag to find multiple matches and include other flags (i, m, u, y) as needed.
([a-z0-9._%+-]+)@([a-z0-9.-]+)\.([a-z]{2,}) -> Matches email addresses and captures user, domain and TLD groups \+?\d{1,3}[ -]?\(?\d{1,4}\)?[ -]?\d{3,4}[ -]?\d{3,4} -> Matches many international phone number formats (\d{4})-(\d{2})-(\d{2}) -> Captures year, month and day from YYYY-MM-DD https?:\/\/[^\s]+ -> Matches http/https URLs \b(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\.){3}(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\b -> Matches IPv4 addresses with valid 0-255 ranges [0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12} -> Matches RFC4122 UUID strings