Originally Posted by
BrianG61UK
Code:
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from re import compile as re_compile
>>>
>>> str = "Blah blah blah blah ... blah blah (S1 E7/22)."
>>>
>>> include = ([], [], ['\(S[5-9]'], [])
>>>
>>> out = ([], [], [re_compile(x) for x in include[2]], [])
>>>
>>> for include in out[2]:
... if include.search(str):
... print("Found")
... else:
... print("Not found")
...
Not found
>>>
>>>
>>> str = "Blah blah blah blah ... blah blah (S6 E7/22)."
>>>
>>> include = ([], [], ['\(S[5-9]'], [])
>>>
>>> out = ([], [], [re_compile(x) for x in include[2]], [])
>>>
>>> for include in out[2]:
... if include.search(str):
... print("Found")
... else:
... print("Not found")
...
...
Found
>>>
So, what is not working for you when you add the escape?