Skip to content

Commit

Permalink
fix: updated QueryStatement regex to match specification
Browse files Browse the repository at this point in the history
  • Loading branch information
dnikolay-ebc committed Oct 28, 2021
1 parent 96cf51c commit 0f1aeb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filip/utils/simple_ql.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def to_str(self):
if not isinstance(self[2], str):
right = str(self[2])
elif self[2].isnumeric():
right = f"'{self[2]}'"
right = f"{self[2]}"
else:
right = self[2]
return ''.join([self[0], self[1], right])
Expand All @@ -178,7 +178,7 @@ def parse_str(cls, string: str):
QueryStatement
"""
for op in Operator.list():
if re.fullmatch(rf"^\w(\w*|\.(?=\w))*{op}\w*", string):
if re.fullmatch(rf"^\w((\w|[^&,?,/,#,*,\s]\w)?)*{op}\w+$", string):
args = string.split(op)
if len(args) == 2:
if args[1].isnumeric():
Expand Down

0 comments on commit 0f1aeb9

Please sign in to comment.