Regular expression to find unescaped double quotes in CSV file

后端 未结 5 674
盖世英雄少女心
盖世英雄少女心 2021-01-03 06:00

What would a regular expression be to find sets of 2 unescaped double quotes that are contained in columns set off by double quotes in a CSV file?

Not a matc

5条回答
  •  被撕碎了的回忆
    2021-01-03 06:25

    Try this regular expression:

    "(?:[^",\\]*|\\.)*(?:""(?:[^",\\]*|\\.)*)+"
    

    That will match any quoted string with at least one pair of unescaped double quotes.

提交回复
热议问题