Skip to content

Commit 7c99d4a

Browse files
glenscJonnyWong16
andauthored
Breaking: Change regex/iregex to use re.search instead of re.match (#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]>
1 parent 26447d1 commit 7c99d4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plexapi/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
'endswith': lambda v, q: v.endswith(q),
2727
'iendswith': lambda v, q: v.lower().endswith(q),
2828
'exists': lambda v, q: v is not None if q else v is None,
29-
'regex': lambda v, q: re.match(q, v),
30-
'iregex': lambda v, q: re.match(q, v, flags=re.IGNORECASE),
29+
'regex': lambda v, q: bool(re.search(q, v)),
30+
'iregex': lambda v, q: bool(re.search(q, v, flags=re.IGNORECASE)),
3131
}
3232

3333

0 commit comments

Comments
 (0)