in reply to Multi-line Regex Performance
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
|
|---|