I need a regular expression to find , where they occur within any ' string '. I tried #'([[^'],])*'#
but this didn't work. What's the simplest way to achieve this so I can replace them. Thanks.
Example:
$str = "(1,2132,'hello world 1, (this is to force it) & another, comma')";
$value_str = preg_replace("#'([[^'],])*'#",'C_1',$str);
Expected output:
'hello world 1C_1 (this is to force it) & anotherC_1 comma'