Regex Tester

Test and debug regular expressions with real-time matching highlight and code generation

Regular Expression
//g
Flags
gglobal
iignore case
mmultiline
sdotAll
uunicode
Common Patterns
Test Text
Match Results0 matches
No matches

Common Syntax

.Match any single character (except newline)
*Match previous token 0 or more times
+Match previous token 1 or more times
?Match previous token 0 or 1 time
^Match start of string
$Match end of string
\dMatch any digit [0-9]
\wMatch any word character [a-zA-Z0-9_]
\sMatch any whitespace
[abc]Match any character in brackets
(a|b)Match a or b
(?:...)Non-capturing group

Flags Reference

  • g (global) - Global match, find all matches
  • i (ignore case) - Case-insensitive matching
  • m (multiline) - Multiline mode, ^ and $ match line boundaries
  • s (dotAll) - Make . match all characters including newlines
  • u (unicode) - Enable full Unicode support