i have this text:
$var = 'bundle:a AND id:9 _query_:" bundle:b AND _query_:"bundle:c AND _query_:"bundle:d" " "';
and would like the following output:
bundle:a AND id:9 _query_:" bundle:b AND _query_:\"bundle:c AND _query_:\"bundle:d\" \""
Edit 1 :
i tried with:
preg_replace('/(?<!_:|_: )"(?=[^"]*?"(( [^:])|([,}])))/', '\\"', $var )
thanks =)