http://qs321.pair.com?node_id=247839


in reply to Regular Expression Question

You're pretty close, but you aren't doing any substitution. You want something more like this:

$pat = "cccv"; $pat =~ s/c/[^aeiou]/g; $pat =~ s/v/[aeiou]/g; if ($word =~ /($pat)/) { $yep++; }
You need to actually substitute the 'c's and 'v's for the character classes before trying to do the matching.

kelan


Perl6 Grammar Student