Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Another regex to solve ...

by pat_mc (Pilgrim)
on Aug 18, 2011 at 16:38 UTC ( #921009=note: print w/replies, xml ) Need Help??


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

Hi, AR -

Thanks for your proposal ... but that's not precisely what I wanted ... I do want words like 'feap' to pass ... only words in which the same vowel is duplicated before the 'p' should be filtered out. Sorry for not making this perfectly clear right from the start.

Any alternative suggestions from your side then?

Cheers -

Pat

Replies are listed 'Best First'.
Re^3: Another regex to solve ...
by AR (Friar) on Aug 18, 2011 at 16:46 UTC
    /((\b|[^aeiou])[aeiou]|[eiou]a|[aiou]e|[aeou]i|[aeiu]o|[aeio]u)p\b/

    but it's not even remotely elegant. I'll keep working on it.

      Hm ... yes, of course ... the explicit disjunction would work. I guess we both agree on the elegance of this solution (or lack thereof) ;-)

      Thanks for posting it, nonetheless!

        Two regexes work:

        $w =~ /([aeiou])p\b/ && $w !~ /${1}${1}p\b/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://921009]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2017-07-23 15:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (347 votes). Check out past polls.