$_ = "aaaabbbbcccc"; if ( not /^(\w\w)\w\w(\w\w)\w\w(\w\w)\w\w$/ ) { die "failed"; } print "$_ = $1 $2 $3\n";