if ($variable =~ /v\d{2}|\d{2}/) { print "$variable"; } else { print "it is not in the proper form"; }