Skip to content

Instantly share code, notes, and snippets.

@jrochkind
Created March 15, 2011 21:27
Show Gist options
  • Save jrochkind/871530 to your computer and use it in GitHub Desktop.
Save jrochkind/871530 to your computer and use it in GitHub Desktop.
correclty parsing...
["foo",
"foo bar",
" foo bar ",
" foo bar baz ",
"+foo",
"-foo",
"+foo -bar",
"one +two three -four five",
"foo AND bar",
"one AND two AND three AND four",
"one OR two OR three OR four",
"white OR blue AND big OR small",
"+yes AND book OR -online",
"(one AND two)",
" ( one AND two ) ",
"(one OR two) three +four",
"(one AND two) OR three",
"(one AND -two) AND (+three OR (-four AND five))",
"one two three NOT four",
"one two three NOT (four OR five)",
"NOT four",
"NOT (four five)",
"(one two three) OR (four five) AND six",
'"foo+bar (baz"',
"(foo bar one AND two) AND (three four ten OR twelve)"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment