if($var =~ /,/) { print "not matches \n"; } elsif($var =~ /(.*)/) { print "matches \n Captured: $1\n"; }