Regular expression to find and replace unescaped Non-successive double quotes in CSV file

后端 未结 3 908
日久生厌
日久生厌 2021-01-06 16:35

This is an extension to a related question answered Here

I have a weekly csv file which needs to be parsed. it looks like this.

\"asdf\",\"asdf\",\"as

3条回答
  •  死守一世寂寞
    2021-01-06 16:44

    (?

    will match a double quote that is not preceded or followed by a comma nor situated at start/end of line.

    If you need to allow whitespace around the commas or at start/end-of-line, and if your regex flavor (which you didn't specify) allows arbitrary-length lookbehind (.NET does, for example), you can use

    (?

提交回复
热议问题