Tutorial
Tools & Languages
Examples
Reference
Catastrophic Backtracking Problem
^
(
.
*?
,
)
{11}
P
Options: ^ and $ match at line breaks
Assert position at the start of the string or after a line break character
Match the regular expression below and capture its match into backreference number 1
Exactly 11 times
Note: You repeated the backreference itself. The backreference will capture only the last iteration. Put the backreference inside a group and repeat that group to capture all iterations.
Match any single character that is not a line break character
Between zero and unlimited times, as few times as possible, expanding as needed (lazy)
Match the character "," literally
Match the character "P" literally
Welcome
Tutorial
Tools and Languages
Examples
Reference
About This Site
Download and Print