Regex Tester
Test and debug regular expressions in real time. See matches, capture groups, and index positions instantly as you type.
All processing happens in your browser — nothing is sent to our servers
//g
Common Regex Patterns
How it worksRegular Expression Matching
01Pattern input
User-supplied regex pattern — parsed by the JavaScript RegExp engine into an internal automaton
→
02Flag configuration
Flags (g, i, m, s, u) modify matching behavior — global, case-insensitive, multiline, dotAll, unicode
→
03Test string
The input text to search against — scanned left to right for pattern matches
→
04Match execution
RegExp.exec() iterates through the string, returning each match with its index position and capture groups
Spec: ECMAScript 2024 §22.2 (RegExp), Unicode Technical Standard #18 (Unicode Regular Expressions)
Regular expressions use backtracking which can cause catastrophic performance on certain patterns. Avoid nested quantifiers like (a+)+ on untrusted input.