I have this code :
$string1 = \"My name is \'Kate\' and im fine\"; $pattern = \"My name is \'(.*)\' and im fine\"; preg_match($pattern , $string1, $matches
You can also use T-Regx library which has automatic delimiters for you:
$matches = pattern("My name is '(.*)' and im fine")->match($string1)->all(); // ↑ No delimiters needed