http://qs321.pair.com?node_id=11119660


in reply to Tricky regex problem

If that (update: oops... I meant to reply to that node) works for you, try this as a simplification (untested):
$input_text =~ s{ ^ ([#]{2,5}) \s+ [^\n]+ \s+ (?= ^ \1 [^#]) } {}xmsg;
Beyond that, I have to say I don't understand your requirements. Can you express them more clearly?


Give a man a fish:  <%-{-{-{-<