Regex Tester

Test, debug, and visualize regular expressions in real-time.

Error:

Pattern
Test String
Matches:
Results
Matches: Groups: Pattern: chars

Regex Cheat Sheet

Character Classes

  • . Any character
  • \d Digit [0-9]
  • \w Word char
  • \s Whitespace
  • [abc] a, b, or c
  • [^abc] Not a, b, c

Anchors

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

Quantifiers

  • * 0 or more
  • + 1 or more
  • ? 0 or 1
  • {n} Exactly n
  • {n,} n or more
  • {n,m} Between n and m

Groups

  • (abc) Capture group
  • (?:abc) Non-capture
  • (?=abc) Lookahead
  • (?!abc) Neg lookahead
  • (?<=abc) Lookbehind
  • (?<!abc) Neg lookbehind