That reads "lines" at a time until it gets to '##' or \Z. Another way you could write it (to be very fast) is:$str =~ /(##(?:.*\n)*)(?=##|\Z)/g
That doesn't even need the look-ahead.$str =~ /(##(?:[^#]+|#[^#])*/g
In reply to Re: Multi-line Regex Performance
by japhy
in thread Multi-line Regex Performance
by pboin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |