I need your regular expression skill to help with finetuning this Java String.split(",") that is not retaining all the delimiter correctly. Below is the type of input string used:
i am looking for a clean as simple solution instead of with StringTokenizer or LinkedList. Would finetuning the regular expression achieve the objective? Otherwise, please advice on other possible better solution.
I completely agree with Adrian on this one.
The apparent simplicity of the CSV format can be deceptive, and trying to parse it using your own regex solution is often not the way to go.
Save yourself some time and frustration and go with a ready-made CSV parser (e.g. opencsv, apache commons CSV, CsvJdbc)
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.