What is catastrophic backtracking in regular expressions?
A performance pitfall where an ambiguous regex pattern forces the regex engine to explore millions of possible match permutations, hanging the CPU.
Test a regular expression against sample text with live match highlighting.
Tests, evaluates, and debugs JavaScript regular expressions in real time with syntax highlighting, flag toggles, and capture group breakdowns.
Matches = RegExp(Pattern, Flags).exec(Target_Text)
Evaluates search patterns with standard PCRE / ECMAScript flags: global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u).
Inputs: Pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ | Target: 'user@example.com'
Summary: Pattern Validated | 1 Full Match Found | Zero Syntax Errors
A performance pitfall where an ambiguous regex pattern forces the regex engine to explore millions of possible match permutations, hanging the CPU.
Greedy quantifiers (*, +) match as much text as possible; lazy quantifiers (*?, +?) match as little text as necessary.
The multiline flag causes ^ and $ to match the start and end of each individual line, rather than the entire input string.