Scanner, comma delimiter and regular expression
807603Jan 12 2008 — edited Jan 15 2008Hi java lovers,
I'm new to regular expression and having some trouble with that. Here is the story:
I have a String like this: 01,0034564,20080108,"William Wallace, Mr.","Percetakan Negara IXA, No. 33",3090000
I want to get each value which are delimited by comma ",", result shall be like this:
01
0034564
20080108
William Wallace, Mr.
Percetakan Negara IXA, No. 33
3090000
Using Scanner class and invoking useDelimiter(",") absolutely will give unexpected result, since we can use Pattern or String with regular expression on useDelimiter() method, what is the regular expression syntax so the Scanner class will give my expected result?
thanks !