Test regular expressions with real-time match highlighting
. any character • \d digit (0-9) • \D non-digit • \w word character (a-z, A-Z, 0-9, _) • \W non-word • \s whitespace • \S non-whitespace • ^ start of string • $ end of string • word boundary
Quantifiers: + one or more • * zero or more • ? zero or one (optional) • {3} exactly 3 • {2,5} between 2 and 5 • {2,} 2 or more
Groups and Alternation: (abc) capture group • (?:abc) non-capturing group • a|b alternation (a or b) • [abc] character class • [^abc] negated class • [a-z] range
Email: ^[\w.-]+@[\w.-]+\.\w{2,}$
URL: https?://[\w./?=&%-]+
Phone (US): \(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}
Date (YYYY-MM-DD): \d{4}-\d{2}-\d{2}
IPv4: \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
Hex color: #[0-9a-fA-F]{3,6}
Enter your regex pattern in the Pattern field and your test string in the Test field. The tool highlights all matches in real time. Use flags to modify behavior: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries). The match count and captured groups are shown below the test area.