Hi m1b, Can you explain (? :\r(? =\r)|$) what it means?
It seems that not grouping is only one aspect.
It's meant to make the lookup hit an end point, but I'm still having trouble understanding it.
I found one that works better, with the addition of an extra \s*,it can contain multiple blank lines, where your original one could only contain one.
(? :\r\s*(? =\r)|($))
But I still can't fully understand it originally.
There's also this (? :^|(? <=\r)\r).
