darwinsys-api icon indicating copy to clipboard operation
darwinsys-api copied to clipboard

Regex Need to be modified

Open uganjha opened this issue 8 years ago • 2 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 ""([^"]?)",?|([^,]),?|,"

uganjha avatar Mar 15 '16 11:03 uganjha

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

IanDarwin avatar Apr 13 '16 16:04 IanDarwin

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?

IanDarwin avatar Oct 07 '16 19:10 IanDarwin