I will get this kind of string from the $_POST
array:
$string = "\"Search Text\"";
OR
$string = '\'Search Text\'';
How I will check whether the Search Text included in double quotes or single quotes using regular expression.
Base on Kolink Answer I did like this
echo $subject = "'Search Text'";
$pattern = "/['\"](?=;$)/";
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
Its not giving any result. :(