in reply to Re^2: Vowel search
in thread Vowel search

I did add that in post, as it occurred to me that was an oversight the OP would likely make if a bread crumb were not left. Of course, the updated code does not include it, so I was unfortunately not obvious enough. If you're concerned with the match performance, it's probably more reasonable to use
$file =~ m{ [AaEeIiOoUu][aeiou] }x
since the simplified English the OP is likely attacking doesn't support two leading capital characters.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^4: Vowel search
by AnomalousMonk (Archbishop) on Jun 12, 2014 at 23:25 UTC
    [effect of /i modifier on] match performance ...

    I thought there might actually be an effect, but tye's benchmark clearly shows otherwise, at least for "recent" Perl versions. (It occurred to me there might be a detectable difference if the benchmark were run against a large array of relatively short strings rather than against one really long one, but I haven't put this to the test yet.)

    ... two leading capital characters.

    I hadn't thought of that aspect of the problem. Not just simplified English, but is there any modern English that supports two capital initials? The only example I can think of off the top of my head is a dipthong, e.g., Æ, but my understanding is that a dipthong is really a single character and I have no idea how it would fit into a "vowel" categorization. If the ligation is broken apart as in "Aesop", the dipthong becomes two quite ordinary vowels and would not, as you point out, both be capitalized. Isn't language (or at least orthography) wonderful?