in reply to Another regex to solve ...

If you define vowel as one of 'a', 'e', 'i', 'o' and 'u' (because I know some other monks will point out that I'm being anglocentric :)), a regex that fits your criteria is:

/(?<![aeiou])[aeiou]p\b/

Please adjust for case sensitivity as necessary.

Edit: Did you mean two vowels in a row or the same vowel twice before the 'p'? The regex above solves the former, but not the latter.

Replies are listed 'Best First'.
Re^2: Another regex to solve ...
by pat_mc (Pilgrim) on Aug 18, 2011 at 16:38 UTC
    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
      /((\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!