Suppose I have a string like:
$str ="Model number is FM223-56/89.";
And I want match the model number only in this string via preg_match
.
I am doing it like:
$model ="FM223-56/89.";
$pattern = '/\b'.$model.'\b/';
echo preg_match($pattern, $str);
But no luck, I want to search word that can have .-,'/"
in it, Is it possible to search via preg_match
?
There is no fixed pattern.