Is there a way to parse a Google search string to a table variable in T-SQL?
By Google search string I mean, including the plus sign (require), minus sign (exclude), and exact phrase (double quotes) operators.
For example the following search string:
one -two +three "four five" -"six seven" +"eight nine" "ten eleven twelve"
Would be parsed to a table variable that I could use to generate a T-SQL where clause:
OPERATOR STRING
one
- two
+ three
four five
- six seven
+ eight nine
ten eleven twelve
Thanks!
Well parsers are written the same way in any language, using a state machine. Nothing like writting a short parser in the morning to get your sinapses lubricated: