Skip to content

Commit

Permalink
fix bug with accented characters in criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
leonelcamara committed Jan 5, 2021
1 parent 5591db1 commit b7d61b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hotxlfp/formulas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'<=': operator.le,
}

REGEX_CRITERIA = re.compile(r'(?P<op>[\<\>\=]*)(?P<val>[\w\d\s\.\*\?]+)')
REGEX_CRITERIA = re.compile(r'(?P<op>[\<\>\=]*)(?P<val>[\w\d\s\.\*\?]+)', re.UNICODE)


def iflatten(iterable):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def test_countif(self):
ret = p.parse('COUNTIF({"foo bar";"baz"};"foo bar")')
self.assertEqual(ret['result'], 1)
self.assertEqual(ret['error'], None)
ret = p.parse('COUNTIF({"foo bar";"áà ãâä"};"áà ãâä")')
self.assertEqual(ret['result'], 1)
self.assertEqual(ret['error'], None)

def test_max(self):
p = Parser(debug=True)
Expand Down

0 comments on commit b7d61b4

Please sign in to comment.