Hi I am debugging a pear package (File_CSV).
At some point for a line all seperators within quotes need to be replaced with an underscore.
The code that is being used right now:
$orgLine = '1001;"test1";"semicolon ; in this string" ';
$line = preg_replace("|^[^"\';]*;*(["\'][^"\']*["\'])|sm", '_', $orgLine);
It is faulty.
I guess the tricky part is within quotes is valid only if lefthand quote-position= oneven and righthand quote-position=even , otherwise the semicolon is used as a seperator.
Anyone any suggestiones?