We have for example a string like this:
"COURSE",247,"28/4/2016 12:53 Europe/Brussels",1,"Verschil tussen merk, product en leveranciersverantwoordelijke NL","Active Enro"
The Goal is to replace the comma between "merk, product" and to keep the comma like "," and ", & ," so we can split the file correctly.
Any suggestions?
Kind regards
解决方案
For a one-time job, you can use this regex (but note that with longer strings, it may not work well, use it as a means of last resort):
,(?!(?:[^"]*"[^"]*")*[^"]*$)
Pattern details:
, - a comma that...
(?! - is not followed with....
(?: -
[^"]* - zero or more chars other than "
" - a double quote
[^"]*" - see above
)* - zero or more sequences of the above grouped patterns
[^"]* - zero or more chars other than "
$ - end of string
) - end of negative lookahead