Regular Expression Tester

Test and debug your regular expressions with live matching and highlighting

Regular Expression

/ /

Test String

Results

Quick Reference

Character Classes

  • \d - Digit (0-9)
  • \w - Word character (a-z, A-Z, 0-9, _)
  • \s - Whitespace
  • . - Any character (except newline)
  • [abc] - Any of a, b, or c
  • [^abc] - Not a, b, or c

Quantifiers

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

Anchors

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

Groups

  • (abc) - Capturing group
  • (?:abc) - Non-capturing group
  • (a|b) - Match a or b
  • (?<name>abc) - Named capture group

Common Patterns