Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Esteemed monks ...
Here's an easy regex question for you ... or is it (I mean: 'easy')? I want to detect all words ending in a vowel followed by the letter 'p'. So far so good. However, I only want the regex to match those words that do not have a double vowel. The regex should thus match 'step' and 'tip' but not 'stoop' or 'steep'. To me it looks like a combination of backreference and look-behind should do the trick ... just how, though, I can't get together. Can you please advise? Thanks in advance and kind regards - Pat EDIT: I tried something to the extent of /(?<!\1)([aeiou])p$/ but, of course, this did not work since the variable length look-behind is not available in the - admittedly very old - version of Perl that I'm using. In reply to Another regex to solve ... by pat_mc
|
|