Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Another regex to solve ...

by Not_a_Number (Parson)
on Aug 18, 2011 at 23:34 UTC ( #921097=note: print w/ replies, xml ) Need Help??


in reply to Re: Another regex to solve ...
in thread Another regex to solve ...

    say unless m{(?<=([aeiou]))\1p\z};

That allows eg 'help' or slurp'.

Update: I've no idea why though, or why it also allows 'hops' and 'hoops'...

Update 2: Got it! It also of course allows 'rabbit', or any other string that doesn't end in 'p' preceded by whatever. It was the unless that momentarily confused me. :)


Comment on Re^2: Another regex to solve ...
Select or Download Code
Re^3: Another regex to solve ...
by johngg (Abbot) on Aug 19, 2011 at 17:38 UTC

    Yes, that was a pretty woeful attempt on my part. I must have been thinking about a sub-set of words all ending with 'p' rather than the general case :-(

    Cheers,

    JohnGG

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-09-19 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls