whats は、XX(a、s、d、f) のすべてのコンマを次のような長い文字列のパイプに置き換える最良の方法です
`exp` x(10) XX('s','44','f','dd','sddd') some other text here, text here , other text here
この部分だけカンマを置き換えたいXX('s','44','f','dd','sddd')
【カッコ内はカンマのみ】
これは私がそれを修正した方法ですが、他のソリューションのためにまだ開いています
while (preg_match('/\(([^\)]*)\)/', $tableCols)){
$tableCols = preg_replace('/\(([^\)]*)\)/e','"[[[".str_replace(\',\',\'|\',\'$1\')."]]]"', $tableCols);
}
$tableCols = str_replace('[[[', '(', $tableCols);
$tableCols = str_replace(']]]', ')', $tableCols);