• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regular expression required

 
Leno Skosan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have the following comma separated values in a string "1234,'abc',null,'def,ghi',5678,'jkl','mno ,pqr, stuv'". What I want to do is to split the string as follows:

1234
'abc'
null
'def,ghi'
5678
'jkl',
'mno ,pqr, stuv'

Any suggestions?
 
Maneesh Godbole
Saloon Keeper
Posts: 11064
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far and where are you stuck?
I would suggest looking into the String class for a method which would help you split the given string (hint)
Agreeably, this would not be an optimal way of doing things, but its the easiest.

Edit: Ok. My bad. I did not read the title mention regular expression.
So, even then, my original question still stands. What have you tried so far and where are you stuck
 
fred rosenberger
lowercase baba
Bartender
Posts: 12143
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not a regex guru. I have no idea how to do this with a regex...but I could probably do it with two.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic