Regex Playground

Pattern Matching Laboratory

Write regular expressions and see matches highlighted in real-time. Supports capture groups, replace mode, and common presets.

Pattern

g i m s u

Replace (optional)

Test String

Result

Matches

Common Patterns

Quick Reference

.Any character (except newline) \d \DDigit / Non-digit \w \WWord char / Non-word \s \SWhitespace / Non-whitespace \bWord boundary ^ $Start / End of line * + ?0+, 1+, 0 or 1 {n,m}Between n and m times [abc]Character class [^abc]Negated class (x)Capture group (?:x)Non-capturing group x|yAlternation (?=x)Positive lookahead (?!x)Negative lookahead