in reply to Regular Expression Question
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 Section
Seekers of Perl Wisdom