Hello everyone,
I want to look for a line containing all five vowels with regular expression. I wrote one, but it is very stupid. do you guys have any good way?
while(<STDIN>){
if ($_!~/\w*a\w*/) {
print "No Vowel a\n";
last;
}
elsif($_!~/\w*e\w*/) {
print "No Vowel e\n";
last;
}
elsif ($_!~/\w*i\w*/) {
print "No Vowel i\n";
last;
}
elsif ($_!~/\w*o\w*/) {
print "No Vowel o\n";
last;
}
elsif ($_!~/\w*u\w*/) {
print "No Vowel u\n";
last;
}
print "$_\n";
}
appreciate any help
I want to look for a line containing all five vowels with regular expression. I wrote one, but it is very stupid. do you guys have any good way?
while(<STDIN>){
if ($_!~/\w*a\w*/) {
print "No Vowel a\n";
last;
}
elsif($_!~/\w*e\w*/) {
print "No Vowel e\n";
last;
}
elsif ($_!~/\w*i\w*/) {
print "No Vowel i\n";
last;
}
elsif ($_!~/\w*o\w*/) {
print "No Vowel o\n";
last;
}
elsif ($_!~/\w*u\w*/) {
print "No Vowel u\n";
last;
}
print "$_\n";
}
appreciate any help