I’m trying to create a regex to tokenize a string. An example string would be.
"hello world" Alexandros Alex "I Am" Something
I need to get responce back:
hello world
Alexandros
Alex
I am
Something
So to make it clear, tokenize with space but not words within quotes.
If this is an easy regural expresion sorry in advance but i always strugle with these.
You could try:
\b(?:(?<=")[^"]*(?=")|\w+)\b. This will exclude the actual quotes from the matches.When executed, you get this output: