regular expression should split , that are contained outside the double quotes in a CSV file?

前端 未结 4 790
情话喂你
情话喂你 2021-01-26 10:00

This is the sample

\"abc\",\"abcsds\",\"adbc,ds\",\"abc\"

Output should be

abc
abcsds
adbc,ds
abc
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-26 10:34

    Try this:

    "(.*?)"
    

    if you need to put this regex inside a literal, don't forget to escape it:

    Regex re = new Regex("\"(.*?)\"");
    

提交回复
热议问题