Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Tricky regex problem

by nysus (Vicar)
on Jul 22, 2020 at 15:11 UTC ( #11119659=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11119659]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2020-10-26 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (250 votes). Check out past polls.

    Notices?