J
JS
I am writing a C# app that needs to parse a sentence entered by the user
for a simple boolean search.
I need to capture all of the AND words that are not inside of double
quotes. However, I am having a heck of a time figuring out a regex for it.
Can anyone assist with a regex to find all the AND's not in double quotes?
An example sentence might be:
red and blue and "crazy elephant" and "orange and red" and stuff.
I would need the 1st, 2nd, 3rd and 5th AND in the sentence, but not the 4th
one that is in "orange AND red".
I have several other parsing expressions in this program, but for some
reason, this particular regex eludes me, and I have been at it for some
time.
Any help would be appreciated.
TIA
-JS
PS: if there is a better usenet group for this question, please advise, as
I could not find one just for regex.
for a simple boolean search.
I need to capture all of the AND words that are not inside of double
quotes. However, I am having a heck of a time figuring out a regex for it.
Can anyone assist with a regex to find all the AND's not in double quotes?
An example sentence might be:
red and blue and "crazy elephant" and "orange and red" and stuff.
I would need the 1st, 2nd, 3rd and 5th AND in the sentence, but not the 4th
one that is in "orange AND red".
I have several other parsing expressions in this program, but for some
reason, this particular regex eludes me, and I have been at it for some
time.
Any help would be appreciated.
TIA
-JS
PS: if there is a better usenet group for this question, please advise, as
I could not find one just for regex.