🔍 Regex Tester
Test and debug regular expressions in real time with match highlighting.
Flags:
Enter a pattern and test string to see match results.
❓ FAQ
Regular expressions (regex) are patterns used to match character combinations in strings. They're used for search, validation (emails, phone numbers, URLs), text replacement, and parsing. Most programming languages support them natively.
\d (digit), \w (word char), \s (whitespace), . (any char), ^ (line start), $ (line end), + (1 or more), * (0 or more), ? (0 or 1), {n,m} (n to m times), [abc] (char set), (abc) (capture group)
Capture groups, written as (pattern), allow you to extract specific parts of a match. For example, (\d{4})-(\d{2})-(\d{2}) on "2026-07-17" captures three groups: "2026", "07", "17". Named groups use (?<name>pattern).
Greedy quantifiers (+, *, {n,}) match as much as possible. Lazy quantifiers (+?, *?, {n,}?) match as little as possible. For example, <.+> on "<a><b>" matches the whole string greedily, while <.+?> matches just "<a>".
A simple pattern: ^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$ — However, the full email spec is extremely complex, so for production use, it's better to send a verification email rather than rely solely on regex validation.
