I have this code :
$string1 = \"My name is \'Kate\' and im fine\"; $pattern = \"My name is \'(.*)\' and im fine\"; preg_match($pattern , $string1, $matches
Please try with this
$pattern = "/My name is '\(.*\)' and im fine/";