c:\@Work\Perl\monks>perl -wMstrict -le "my $vowel = qr{ [AEIOUaeiou] }xms; ;; my $s = 'xyzzyBARxkcdFOOyz'; ;; print 'offset of first vowel: ', $s =~ m{ (?= $vowel) }xms ? $+[0] : 'none'; print 'offset of last vowel: ', $s =~ m{ .* (?= $vowel) }xms ? $+[0] : 'none'; print 'offset of first vowel: ', 'XYZ' =~ m{ (?= $vowel) }xms ? $+[0] : 'none'; " offset of first vowel: 6 offset of last vowel: 14 offset of first vowel: none