Closed gabor1 closed 4 years ago
I suspect the parser of the query string is not capable to handle special characters (like '') properly and ignores them. In the first case, it is ok because ".*H.\" actually equivalent to "H".
.* Is a very specific regexp thing. You should be just passing the entire things in the quotes to the regexp.
-- Gábor
On 15 Jul 2019, at 17:54, Adam Fekete notifications@github.com wrote:
I suspect the parser of the query string is not capable to handle special characters (like '*') properly and ignores them. In the first case, it is ok because ".H." actually equivalent to "H".
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I updated the parser's regexp to parse regex expressions. This is just a quick workaround, not the long term solution.
I thought you just pass the entire string to dinner python regexp function. Why is this not the final solution?
-- Gábor
On 15 Jul 2019, at 21:09, Adam Fekete notifications@github.com wrote:
I updated the parser's regexp to parse regex expressions. This is just a quick workaround, not the long term solution.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
The query should support complex expressions, like 'and' or 'or', so the following commands should be equivalent to each other:
abcd summary -q volker -q formula~".*H.*"
abcd summary -q "volker formula~.*H.*"
abcd summary -q "volker and formula~.*H.*"
To parse all the possible query options I have a 'lexer' a 'parser' and 'compiler' which produce an abstract syntaxt tree (AST) at the end. Ideally all the three variation above should have the same AST.
Finally if there any regex in the AST I pass it to the mongo database which will use it to filter the data.
It is a temporary solution because solving the issue #6 and #25 will provide a more stable solution.
Decision: we decided to require all strings, including regexps to be quoted, that will help resolve all of this.