Regex Tester

Test and debug regular expressions in real-time. See matches highlighted, capture groups extracted, and explanations of your pattern.

g = global, i = case-insensitive, m = multiline, s = dotall

Common Patterns

Email[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
Urlhttps?://[^\s]+
Phone_Us\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}
Ipv4\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
Date_Iso\d{4}-\d{2}-\d{2}
Time_24h\b([01]?[0-9]|2[0-3]):[0-5][0-9]\b
Hex_Color#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b
Credit_Card\b\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}\b
Zip_Us\b\d{5}(-\d{4})?\b
Html_Tag<[^>]+>

How to Use

  1. Enter your regex pattern
  2. Paste test text
  3. See matches highlighted
  4. Adjust pattern as needed

About This Tool


Regular expressions are powerful patterns for matching text. Our tester helps you build and debug regex patterns with real-time feedback.

As you type your pattern and test text, matches are highlighted instantly. Capture groups are shown separately so you can verify your extractions.

Support for all standard flags: global (g) for multiple matches, case-insensitive (i), multiline (m), and dotall (s). The match count shows how many times your pattern matches.

Our library of common patterns provides starting points for emails, URLs, phone numbers, and more. Use these as templates and customize for your needs.

FAQ

What are capture groups?
Capture groups (parentheses in your pattern) extract specific parts of the match. Group 0 is the full match, group 1 is the first parentheses, etc.
What does the g flag do?
The global (g) flag finds all matches instead of stopping at the first one.
Why is not my pattern matching?
Common issues: forgetting to escape special characters (. * + ?), incorrect flags, or pattern too specific.
What is the difference between * and +?
* matches zero or more, + matches one or more. a* matches "" and "aaa", a+ only matches "a" and "aaa".
How do I match special characters?
Escape them with backslash: \. for period, \* for asterisk, \\ for backslash.