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


in reply to Tricky regex problem

I came up with this, which is faintly ridiculous:

$input_text =~ s/^##\s+[^\n]+\s+(?=^##[^#])//gsm; $input_text =~ s/^###\s+[^\n]+\s+(?=^###[^#])//gsm; $input_text =~ s/^####\s+[^\n]+\s+(?=^####[^#])//gsm; $input_text =~ s/^#####\s+[^\n]+\s+(?=^#####[^#])//gsm;

I just googled "conditional regular expression" and it seems that is a thing and it might help me. Not sure yet.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks