$thestring = "13,130,213"; $thecheck = "13"; if ($thecheck =~ /$thestring/) { print "$thecheck is in $thestring"; }