Regex Tester

Test regular expressions with real-time matching. Debug and validate regex patterns with sample text.

Perfect your regular expressions with our powerful online tester. See matches in real-time, debug patterns, and validate your regex with comprehensive feedback and highlighting.

Real-time pattern matching
Syntax error detection
Match highlighting
Capture group support
Multiple regex flags
Sample pattern library
Common Regex Patterns
Email validation
/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
Matches a standard email format.
Phone number (XXX-XXX-XXXX)
/^\d{3}-\d{3}-\d{4}$/
Matches North American phone numbers.
URL validation
C/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/
Matches most common URL formats.
IP Address (v4)
/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/
Matches a standard IPv4 address.

How to Use

  1. Enter your regular expression pattern in the regex input field
  2. Select appropriate flags (global, ignore case, multiline, etc.) if needed
  3. Enter or paste your test text in the text area
  4. View real-time results with highlighted matches and detailed match information
  5. Use sample patterns to get started or learn common regex patterns

Frequently Asked Questions

What are regex flags and when should I use them?

Regex flags modify how the pattern matching works. Global (g) finds all matches, Ignore Case (i) makes matching case-insensitive, Multiline (m) makes ^ and $ match line breaks, and Dot All (s) makes . match newlines.

How do I test for multiple patterns?

Use the alternation operator (|) to test multiple patterns. For example, "cat|dog" will match either "cat" or "dog" in your text.

What are capture groups and how do they work?

Capture groups are parts of your regex enclosed in parentheses (). They capture the matched text for later use. Our tool shows you all capture groups for each match.

Can I save my regex patterns?

This tool runs entirely in your browser for privacy. You can bookmark the page or copy your patterns to save them locally.