$re = '/^((?:[^,\n"]*(?:"[^\n"]*"[^,\n"]*)*,){57})("?[a-zA-Z_][^"\n]*"?)(,\d{2},\d{4}.*)$/m';
$str = '30,kUsUO,6,18,97,42,SAM,lmhYK,49,aLaTA,51,34,3,49,75,39,pdwvW,54,7,63,12,25,26,SJ12u,rUFUV,34,xXBv3,XHtz4,r4Fyh,14,20,0jZL2,izrsC,44,K5Kw3,8,tcKu7,5,RPLcy,kg4IR,Kvs3p,lyG09,dJmZB,34,84,7,qED2y,8uNen,5,96,81,88,bGgqK,FAsIV,81,YXZ,PQR,Flat No B1002, Balaji Whitefield society, sus road, pune,Mh,22,591213,LbAo7,21,18,text,,,,,
30,kUsUO,6,18,97,42,**"SAM,K,KARAN"** lmhYK,49,aLaTA,51,34,3,49,75,39,pdwvW,54,7,63,12,25,26,SJ12u,rUFUV,34,xXBv3,XHtz4,r4Fyh,14,20,0jZL2,izrsC,44,K5Kw3,8,tcKu7,5,RPLcy,kg4IR,Kvs3p,lyG09,dJmZB,34,84,7,qED2y,8uNen,5,96,81,88,bGgqK,FAsIV,81,YXZ,PQR,Flat No B1002,Balaji Whitefield society, sus road, pune,Mh,22,591213,LbAo7,21,18,text,,,,,';
$subst = "$1\"$2\"$3";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php