Tutorial
Tools & Languages
Examples
Reference
Catastrophic Backtracking Solution Using Atomic Grouping and Possessive Quantifiers
^
(?>
(
[^,\r\n]
*+
,
)
{11}
)
P
Options: ^ and $ match at line breaks
Assert position at the start of the string or after a line break character
Atomic group. Match the regex below, and do not try further permutations of it if the overall match fails.
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, without giving back (possessive)
Match the character "," literally
Match the character "P" literally
Welcome
Tutorial
Tools and Languages
Examples
Reference
About This Site
Download and Print