In a malformed .csv file, there is a row of data with extra double quotes, e.g. the last line:
Name,Comment
\"Peter\",\"Nice singer\"
\"Paul\",\"Love \"folk\" so
-
In Ruby 1.9, the following works:
result = subject.gsub(/(?
Previous versions don't have lookbehind assertions.
Explanation:
(?
Of course this assumes that we won't run into pathological cases like
"Mary",""Oh," she said"
- 热议问题