Regex Visualizer

Break down any regex pattern token by token. See exactly what each character does —quantifiers, anchors, groups, escapes, and character classes —with color-coded explanations.

Enter a regex pattern to see its syntax tree...

🟢📖 Reading Regex Syntax

Regular expressions are a declarative language for matching text. Every regex pattern can be decomposed into these token types:

  • ^ Anchors —match position, not characters (^ $ \b \B)
  • + Quantifiers —how many times to match (+, *, ?, {n,m})
  • ( ) Groups —capture sub-patterns for extraction or backreferencing
  • [a-z] Character classes —match any character in a set
  • \d Escapes —shorthand for common character sets
  • | Alternation —match pattern A OR pattern B

See also: Regex Tester · Regex Cheatsheet · Regex Replace