🔍 Regex Tester

Test and debug regular expressions with real-time pattern matching and highlighting. Perfect for developers validating input patterns, extracting data, and testing complex regex patterns.

📊 Highlighted Matches:
Enter text and regex pattern, then click "Test Regex" to see highlighted matches...
💡 How to use:
  • Enter sample text you want to search in the textarea
  • Enter your regex pattern in the pattern field
  • Optionally add flags (g=global, i=ignore case, m=multiline, s=dotall)
  • Click "Test Regex" to see highlighted matches
  • Matches will be highlighted in yellow
  • Error messages will display if the regex is invalid

📝 Common Regex Patterns:

Pattern Description Example
\d+ One or more digits 123, 4567
[a-z]+ One or more lowercase letters hello, world
[A-Z]+ One or more uppercase letters HELLO, WORLD
[a-zA-Z0-9]+ Alphanumeric characters abc123, XYZ789
\w+ Word characters (letters, digits, underscore) hello_world, test123
\s+ Whitespace characters spaces, tabs, newlines
[a-z]+@[a-z]+\.[a-z]+ Simple email pattern user@example.com
^https?:\/\/ HTTP/HTTPS URLs https://example.com
\b\w{3,}\b Words with 3+ characters hello, world
^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$ IP Address pattern 192.168.1.1
📚 Regex Flags:
  • g - Global: Find all matches (not just first)
  • i - Ignore Case: Case-insensitive matching
  • m - Multiline: ^ and $ match line breaks
  • s - Dotall: . matches newlines
  • gi - Combine flags: Global + Ignore Case
💡 Tip: Always use the 'g' flag to find all matches in your text. Without it, only the first match is found.