IanDarwin / darwinsys-api

Ian Darwin's semi-random collection of Java APIs, all subject to change without notice.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regex Need to be modified

uganjha opened this issue · comments

CSVRE.java has issue

*""([^\"]+?)",?|([^,]+),?|," * reg-ex can not match occurrence where if any column of csv has no value.

Like ,,,,,"0",,"0","0",,,"12/13/2015 12:10:00 AM","2.94","12/13/2015 12:10:00 AM","13.69"

so it should be ""([^\"]?)",?|([^,]),?|,"

Thanks. Busy with Android Cookbook now, will get this tested and installed after that.

Did you run the tests? Your change breaks a bunch of CSVRETests, not just the one with the empty field, so I think it's not as simple as your first attempt. Maybe a non-greedy match will be better?