in reply to Re: Checking for occurrence in comma separated string
in thread Checking for occurrence in comma separated string

You need to be sure that the whole number is either surrounded by , or the beggining or end of line:
$thestring = "15,130,213"; if ($thestring =~ /(^13,)|(,13,)|(,13$)/) { print "13 is in $thestring +"; } else { print "13 is not in $thestring"; }
This is not a very good regexp but it's only an example. I suggest to read more about regular expressions, then start asking question about the difficult parts not the standards covered in almost every regex tutorial.