Indeed, this is the approach I had in mind. My idea was to look for the least frequently occurring vowel first, up to the most frequently occurring vowel last. That way candidates could be excluded as quickly as possible. The following one-liner, when run on /usr/share/dict/words
perl -nle '++$f{lc $_} for split //; END{ print "$_\t$f{$_}" for sort keys %f}'... allows me to determine that the order is u o a i e. My test, relying on the benefit of lazy evaluation, would be:
# assuming target word is in $_ my $all_there = /u/ and /o/ and /a/ and /i/ and /e/;
Disclaimer about case sensitivity: you might want to $_ = lc $_ beforehand, or add the i modifier to each RE.
I find this code is very elegant: clear and straightforward, and above all, the person coming along behind you will understand immediately what is going in without requiring major regexp-fu.
In reply to Re:x2 regex testing for ALL of the vowels in a scalar
by grinder
in thread regex testing for ALL of the vowels in a scalar
by D'Oh!!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |