in reply to finding nonword character at end of strings
Replace a whitespace, a vowel, and a colon, not followed by something that isn't whitespace, with a space and said vowel. Alternatively, if you know the first whitespace is always a space (or if you just want to keep whatever whitespace it was), you could use a zero width positive lookbehind:$f =~ s/\s([iaeouyE]):(?!\S)/ $1/;
The (?<= ) construct is the lookbehind. There's more about lookaheads and lookbehinds in the perlre manual page.$f =~ s/(?<=\s[iaeouyE]):(?!\S)//;
-- Abigail
|
|---|