Tools

Regex Tester

Test regular expressions in real-time and see matching results instantly.

No matches found.

About Regex Tester

Regular expressions (regex) are powerful patterns used to match character combinations in strings. • Pattern input: Enter a regex pattern to see matching results in real-time. • Flags: Combine g (global), i (case-insensitive), and m (multiline) flags. • Capture groups: Use parentheses () to capture sub-matches and inspect group results. • Highlighting: Matched portions are visually highlighted in the test string.

Common Regex Patterns

• Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} • Phone (US): \(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4} • URL: https?://[\w.-]+(?:\.[\w]+)+[\w.,@?^=%&:/~+#-]* • IPv4: (?:\d{1,3}\.){3}\d{1,3} • Date (YYYY-MM-DD): \d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])

FAQ

What does the g flag do?
The g (global) flag finds all matches in the string rather than stopping after the first match. Without it, only the first match is returned.
What is the i flag for?
The i (case-insensitive) flag makes the pattern match regardless of letter case. For example, /hello/i matches "Hello", "HELLO", and "hello".
What are capture groups?
Capture groups are portions of a pattern enclosed in parentheses (). They allow you to extract specific parts of a match separately, which is useful for parsing structured text like dates, emails, or URLs.

Related Tools