Regex Tester

Test and debug regular expressions

Regular Expression

//
Valid
Common flags:gglobaliignore casemmultilinesdotall

Quick Examples

Test String

Matches (0)

No matches found

Highlighted Text

Text with matches highlighted will appear here...

Replace

Use $1, $2, etc. for capture groups

Replacement result will appear here...

Regex Cheat Sheet

Character Classes

  • . Any character
  • \\d Digit
  • \\w Word character
  • \\s Whitespace
  • [abc] Any of a, b, c

Quantifiers

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

Anchors

  • ^ Start of string
  • $ End of string
  • \\b Word boundary
  • (?=...) Lookahead
  • (?!...) Negative lookahead