How do I parse this string in java The value in the string is separated by 1 or more space
queryStr= XX -YY "this is test"
"this is a test"
queryStr = -XX YY -"this is a test"
-"this is a test"
I have this pattern in my java code
Matcher m = Pattern.compile("([^\"]\\S
It parses the first string correctly. However, it does not work for the second case (the string in quote with the operator in front"
How can I fix the pattern to make it work in both cases.
Thanks for your help