Regex Tester

Test and debug your regular expressions in real-time. See matches highlighted, view capture groups, and toggle flags. Runs entirely in your browser - no data ever leaves your device.

//g
JavaScript regex syntax
Quick Reference

Characters

  • . - Any character
  • \d - Digit
  • \w - Word char
  • \s - Whitespace

Quantifiers

  • * - 0 or more
  • + - 1 or more
  • ? - 0 or 1
  • {n} - Exactly n

Anchors

  • ^ - Start
  • $ - End
  • \b - Word boundary

Groups

  • (abc) - Group
  • (?:abc) - Non-capture
  • [abc] - Char class
  • a|b - Or

Regex Flags

g
Global
Find all matches
i
Insensitive
Ignore case
m
Multiline
^ $ per line
s
Dot All
. matches \n
u
Unicode
Unicode support

Common Patterns

Email[a-z]+@[a-z]+\.[a-z]+
URLhttps?://[^\s]+
Phone\d{3}-\d{3}-\d{4}
Zip Code^\d{5}(-\d{4})?$

Tips

  • Use global flag (g) to find all matches
  • Escape special chars: \. \[ \( etc.
  • Use (?:...) for non-capturing groups
  • Test edge cases and special characters