That being said, though, this:
should do you pretty easily. Granted, it makes use of positive look-ahead which isn't strictly speaking "regular". The basic description of the regex is: there exists a place in the string (the beginning of the string, for example), after which exists an "a" AND after which exists an "e", etc./(?=.*a)(?=.*e)(?=.*i)(?=.*o)(?=.*u)/i
To do this with a true regular expression (and hence without lookahead assertions), you'd want to do it by essentially creating a list of all 5-factorial permutations of aeiou, and, over these permutations like so (written out kind of long-hand so that the idea should be transparent):
my @regex_pieces = (); foreach my $permutation (@permutations) { my @vowels = split //, $permutation; push @regex_pieces, join(".*", @vowels); } my $regex = qr/@{[join("|", @regex_pieces)]}/i;
------------ :Wq Not an editor command: Wq
In reply to Re: regex testing for ALL of the vowels in a scalar
by etcshadow
in thread regex testing for ALL of the vowels in a scalar
by D'Oh!!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |