Skip to content

Commit

Permalink
Don't treat digits with leading zeroes as correct numbers (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 committed Feb 23, 2024
1 parent 2c1cf9c commit 28a0362
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mwdb/core/search/parse_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def is_nonstring_object(value: str) -> bool:
Checks if string value may be also a number or boolean,
so JSON must be queried using both types
"""
return bool(re.match(r"^(false|true|null|\d+([.]\d+)?)$", value))
return bool(re.fullmatch(r"(false|true|null|(0|[1-9]\d*)([.]\d+)?)", value))


def is_pattern_value(value) -> bool:
Expand Down

0 comments on commit 28a0362

Please sign in to comment.