R
rcurts
I'm having trouble finding a regular expression to do what I want.
I get a string that I want to split by spaces, and the tokens may or
may not be encapsulated by quotes.
I would like to take:
DOG CAT "LAUGHING HYENA" BIRD
and get
0: DOG
1: CAT
2: LAUGHING HYENA
3: BIRD
I won't know if a token will come through encapsulated by quotes or
not. I was thinking of looping through each char in the string, but I
can only hope there's a better way to do this.
Any ideas?
Thanks
rcurts
I get a string that I want to split by spaces, and the tokens may or
may not be encapsulated by quotes.
I would like to take:
DOG CAT "LAUGHING HYENA" BIRD
and get
0: DOG
1: CAT
2: LAUGHING HYENA
3: BIRD
I won't know if a token will come through encapsulated by quotes or
not. I was thinking of looping through each char in the string, but I
can only hope there's a better way to do this.
Any ideas?
Thanks
rcurts