Regex to find strings separated by comma, and then add quotes?

两盒软妹~` 提交于 2019-12-07 18:48:32

问题


I'm using Sublime Text 3 and have a CSV file with 1200 tax rates in this format:

Code,Country,State,Zip/Post Code,Rate,default
US-NY-10001-Rate 1,US,NY,10001,0.08875,
....

I need a regex to find each value separated by a comma so I can then wrap quotes around it.

Is this possible?


回答1:


Find the following regular expression (using capturing group and backreference):

([^,\n]+)

and replace it with:

"\1"



来源:https://stackoverflow.com/questions/24741214/regex-to-find-strings-separated-by-comma-and-then-add-quotes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!