I want to split a string using spaces but not considering double quotes or single quotes.
I tried using Regex for splitting a string using space when not surrounded by single or double quotes but it failed in some cases.
Input : It is a "beautiful day"'but i' cannot "see it"
and the output should be
It
is
a
"beautiful day"'but i'
cannot
"see it"
The regex in above link resulted in
It
is
a
"beautiful day"
'but i'
cannot
"see it"
I want "beautiful day"'but i'
in the one line.
Can somebody help me in writing the correct regex?