R
Robert Oschler
Can someone give me a regex expression that will split a sentence containing
words and double-quoted phrases, into an array? I don't want the words
between the double-quotes to be split using the space (or comma) character
as a delimiter. I can do one or the other, tokenize the words or tokenize
the double-quoted strings, but I can't figure out how to combine the two
into the same regex expression. Note: I *do* want to capture (retain) the
double-quotes.
For example:
I want:
1>dogs
2>cats
3>and
4>"other things"
not:
1>dogs
2>cats
3>and
4>"other
5>things"
Thanks.
words and double-quoted phrases, into an array? I don't want the words
between the double-quotes to be split using the space (or comma) character
as a delimiter. I can do one or the other, tokenize the words or tokenize
the double-quoted strings, but I can't figure out how to combine the two
into the same regex expression. Note: I *do* want to capture (retain) the
double-quotes.
For example:
dogs cats and "other things".
I want:
1>dogs
2>cats
3>and
4>"other things"
not:
1>dogs
2>cats
3>and
4>"other
5>things"
Thanks.