Regex Tester & Debugger

Enter a regular expression and test text to see live match highlighting. Debug patterns instantly without writing any code.

How to Use the Regex Tester

  1. Enter your regular expression pattern in the Pattern field (without leading/trailing slashes).
  2. Set regex flags in the Flags field (e.g., g for global, i for case-insensitive).
  3. Paste or type your test text in the Text area.
  4. Matches are highlighted in yellow in real time as you type.
  5. Click Share to copy a URL with your pattern, flags, and text pre-filled.

Regex Flags Explained

  • g — Global: find all matches, not just the first one.
  • i — Case-insensitive: match uppercase and lowercase letters equally.
  • m — Multiline: ^ and $ match start/end of each line, not just the whole string.
  • s — Dotall: makes . match newline characters too.
  • u — Unicode: enables full Unicode matching.

Common Regex Patterns

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