Skip to content

Commit

Permalink
Breaking: Change regex/iregex to use re.search instead of re.match (#…
Browse files Browse the repository at this point in the history
…1358)

* Change regex/iregex to use re.search instead of re.match

This is BREAKING CHANGE

* Also cast to bool.

Co-authored-by: JonnyWong16 <[email protected]>

---------

Co-authored-by: JonnyWong16 <[email protected]>
  • Loading branch information
glensc and JonnyWong16 authored Feb 17, 2024
1 parent 26447d1 commit 7c99d4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plexapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
'endswith': lambda v, q: v.endswith(q),
'iendswith': lambda v, q: v.lower().endswith(q),
'exists': lambda v, q: v is not None if q else v is None,
'regex': lambda v, q: re.match(q, v),
'iregex': lambda v, q: re.match(q, v, flags=re.IGNORECASE),
'regex': lambda v, q: bool(re.search(q, v)),
'iregex': lambda v, q: bool(re.search(q, v, flags=re.IGNORECASE)),
}


Expand Down

0 comments on commit 7c99d4a

Please sign in to comment.