Regex Tester

Test, debug, and verify your JavaScript regular expressions with real-time highlighting.

/ /
Test String
Match Result 0 Matches

Regex Cheatsheet

Character Classes

  • . Any character
  • \w Word char [a-zA-Z0-9_]
  • \d Digit [0-9]
  • \s Whitespace
  • [abc] Character set
  • [^abc] Negated set

Quantifiers

  • * 0 or more
  • + 1 or more
  • ? 0 or 1
  • {3} Exactly 3
  • {3,} 3 or more
  • {2,5} Between 2 and 5

Anchors & Flags

  • ^ Start of line
  • $ End of line
  • \b Word boundary
  • g Global flag
  • i Case insensitive
  • m Multiline