Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Words which incorporate "and", "or" or "not" confuse the parser. #1

Open
soferio opened this issue May 30, 2015 · 0 comments
Open

Words which incorporate "and", "or" or "not" confuse the parser. #1

soferio opened this issue May 30, 2015 · 0 comments

Comments

@soferio
Copy link

soferio commented May 30, 2015

If you attempt to filter using the word "Notice", it wil be treated as "not" "ice".

The regexes which identify the "and", "or", "not" operators should be modified to terminate with a word boundary regex, being "\b". So my proposal is that lines 38, 46 and 50 in expression.js be modified as follows:

Line 38 would change from:

return this.match(/^NOT/i).toUpperCase();

to:

return this.match(/^NOT\b/i).toUpperCase();

and lines 46 and 50 would be similarly modified.

TXMuc added a commit to TXMuc/boolean-expression-js that referenced this issue Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant