Skip to content

Commit

Permalink
api: re.match with beginning/end wildcards -> re.search
Browse files Browse the repository at this point in the history
  • Loading branch information
booto committed Apr 8, 2019
1 parent 7587954 commit 1cc4bfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _filter_string(sessions, key, value, match=False):

for session in sessions:
if match:
if re.match(".*" + re.escape(value) + ".*", str(session[key]), re.IGNORECASE):
if re.search(re.escape(value), str(session[key]), re.IGNORECASE):
filtered_sessions.append(session)
else:
if session[key] == value:
Expand Down

0 comments on commit 1cc4bfb

Please sign in to comment.