How can I implement regular expression to String.split() to seperate values by spaces and ignore double quoted text?
Like in the below example.
hello "Luis Anderson" your age is 30 and u will get $30
this, list of strings:
'hello', '"Luis Anderson"', 'your', 'age', 'is', '30', 'and', 'u', 'will', 'get', '$30'
The problem is that when I'm using String.split(), it takes in consideration also phrase between "Luis Enderson" and spliting it in 2 strings.
If you got any other ideas which not include usage of regular expression please explain it, thanks.
SIMILAR QUESTION how to split string by space but escape spaces inside quotes (in java)?