Tutorial
Tools & Languages
Examples
Reference
Catastrophic Backtracking Solution
^
(
[^,\r\n]
*
,
)
{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 a single character not present in the list: one of the characters ",", or a carriage return, or a line feed
Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Match the character "," literally
Match the character "P" literally
Welcome
Tutorial
Tools and Languages
Examples
Reference
About This Site
Download and Print