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

You can also prepend and append a comma to your strings, and use index to quickly search for it. It may likely be faster than a dynamically built regexp.
if(index(",$thestring,", ",$thecheck,") >= 0) { ... }
That will search for ",13," inside the string ",13,130,213,".