Interactive Regex Playground

Test and learn regular expressions with real-time highlighting and explanations. Type a regex pattern and sample text to see matches instantly.

1

Tip: Use flags like g (global), i (case-insensitive), m (multiline)

Matches Preview

Results will appear here...

Matched text is highlighted in green

Match Details

Detailed match information will appear here...

Regex Pattern Breakdown

Pattern breakdown will appear here...

Regex Reference Guide

Common Characters

  • . - Any character except newline
  • ^ - Start of string/line
  • $ - End of string/line
  • \d - Digit [0-9]
  • \w - Word character [a-zA-Z0-9_]
  • \s - Whitespace

Quantifiers

  • * - Zero or more
  • + - One or more
  • ? - Zero or one
  • {n} - Exactly n times
  • {n,} - n or more times
  • {n,m} - Between n and m times

Groups & Alternation

  • ( ) - Capturing group
  • (?: ) - Non-capturing group
  • [ ] - Character class
  • [^ ] - Negated character class
  • | - Alternation (OR)