Why not use explode to put the string into an array? That way, you can check for the numbers individually using the [man]in_array[/man] function, instead of relying on string manipulation:
example:
$valuecheck = "21";
$string = "2#21#35#3#78#12#90#";
$stringArray = explode("#", $string);
if(in_array($valuecheck, $stringArray)){
echo "Yep, $valuecheck is in there!";
} else {
echo "Nope, $valuecheck is not in there!";
}
I just suggest this, because I personally like to avoid regular expressions as much as I possibly can. 😃