You're pretty close, but you aren't doing any substitution. You want something more like this:
You need to actually substitute the 'c's and 'v's for the character classes before trying to do the matching.$pat = "cccv"; $pat =~ s/c/[^aeiou]/g; $pat =~ s/v/[aeiou]/g; if ($word =~ /($pat)/) { $yep++; }
kelan
Perl6 Grammar Student
In reply to Re: Regular Expression Question
by kelan
in thread Regular Expression Question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |