Regex Tester

Test and debug regular expressions in real-time

Results

Enter a regex pattern and test string to see matches.

Regex Cheat Sheet

Character Classes

  • . Any character except newline
  • \d Digit (0-9)
  • \D Not digit
  • \w Word character (a-z, A-Z, 0-9, _)
  • \W Not word character
  • \s Whitespace (space, tab, newline)
  • \S Not whitespace

Anchors

  • ^ Start of string
  • $ End of string
  • \b Word boundary
  • \B Not word boundary

Quantifiers

  • * 0 or more
  • + 1 or more
  • ? 0 or 1
  • {3} Exactly 3
  • {3,} 3 or more
  • {3,5} 3, 4 or 5