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 9, 2019
1 parent 45f14ce commit a2275e8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions netplay_index/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,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 a2275e8

Please sign in to comment.