Regex Tester

Test and debug regular expressions in real-time. See matches highlighted, capture groups, and detailed match information.

Regular Expression

//g

Flags

Global (g)

Find all matches

Case Insensitive (i)

Ignore case

Multiline (m)

^ and $ match line start/end

Dot All (s)

. matches newlines

Unicode (u)

Enable Unicode support

Sticky (y)

Match from lastIndex only

Test String

Highlighted Matches

No matches

Quick Reference

Character Classes

  • . - Any character
  • \d - Digit [0-9]
  • \w - Word [A-Za-z0-9_]
  • \s - Whitespace
  • [abc] - Any of a, b, c
  • [^abc] - Not a, b, c

Quantifiers

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

Anchors

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

Groups & Lookaround

  • (abc) - Capture group
  • (?:abc) - Non-capture
  • (?=abc) - Lookahead
  • (?<name>) - Named group
  • a|b - Or