this is more of a text parsing/regex kind of question, but i figured
i'd start here. please let me know if this should go somewhere else.
I'd like to implement google-like search syntax, a la
http://www.google.ca/help/refinesearch.html
so a text query like this:
("google search" "regular expressions") OR (syntax text)
aSpecificField:somevalue
[some intermediate object that holds the expressions]
and turns into an sql query like this:
([aSpecificField] LIKE '%somevalue%') AND
(([field1] LIKE '%google search%' AND [field1] LIKE '%regular
expression%') OR ([field1] LIKE '%syntax%' AND [field1] LIKE '%text%'))
OR (([field2...repeat for all fields
basically i am having trouble figuring out how to parse the text query
to keep track of brackets and double-quoted expressions. am more
interested in parsing the text than turning it into SQL.
anyone have a reference that shows this being done?
thanks in advance!