Possible Duplicate:
Regex for splitting a string using space when not surrounded by single or double quotes
How can I break a string like this:
String args = "\"file one.txt\" filetwo.txt some other \"things here\"";
into its arguments / parameters while respecting quotes?
So in the above example, the arguments would be broken into:
args[0] = file one.txt
args[1] = filetwo.txt
args[2] = some
args[3] = other
args[4] = things here
I understand how to use split(" "), but I want to combine terms that are in quotes.