File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Regular expression required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Regular expression required" Watch "Regular expression required" New topic

Regular expression required

Leno Skosan

Joined: Apr 23, 2010
Posts: 3
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:

'mno ,pqr, stuv'

Any suggestions?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10770

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

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11926

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.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: Regular expression required
jQuery in Action, 3rd edition