Is there a way using Java String.split(regexp) to split on strings inside of quotes, and not get the quotes?
The strings I have to deal with are like the following. I don't have control of the format and the number of strings are variable:
"strA" : "strB" : "strC" : "strD",
"strE" : "strF" : "strG",
Note: The spaces are included, and each line is handled separately. So what I would like to get is an array with all strings.
I could use replaceAll to strip the quotes, spaces and commas, then split on the colon:
line = line.replaceAll(/(\"|,\\s+)/,"");
usrArray = line.split(":");
But I'd like to do this with one regexp.