Regular expression to match CSV delimiters

后端 未结 6 980
天命终不由人
天命终不由人 2020-12-17 22:39

I\'m trying to create a PCRE that will match only the commas used as delimiters in a line from a CSV file. Assuming the format of a line is this:

1,\"abcd\",         


        
6条回答
  •  自闭症患者
    2020-12-17 23:12

    CSV parsing is a difficult problem, and has been well-solved. Whatever language you are using doubtless has a complete solution that takes care of it, without you having to go down the road of writing your own regex.

    What language are you using?

提交回复
热议问题