Skip to content

Commit

Permalink
Merge pull request #2 from booto/re
Browse files Browse the repository at this point in the history
api: re.match with beginning/end wildcards -> re.search
  • Loading branch information
spycrab authored Apr 9, 2019
2 parents 45f14ce + a2275e8 commit b1b9874
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 b1b9874

Please sign in to comment.