Let's say I have a query string like that:
#some terms! "phrase query" in:"my container" in:group_3
or
#some terms!
or
in:"my container" in:group_3 terms! "phrase query"
or
in:"my container" test in:group_3 terms!
What is the best way to parse this correctly?
I've looked at Lucene's SimpleQueryParser but it seems quite complicated for my usecase. And I'm trying to parse that query using regexes but not really successful until now, mostly due to the possibility of using whitespace inside quotes
Any simple idea?
I just need to get as output a list of elements, afterward it's pretty easy for me to solve the rest of the problem:
[
"#some",
"terms!",
"phrase query",
"in:\"my container\"",
"in:group_3"
]