-1

I have the following code:

import re

regexes = [
    re.compile('foo'),
]

mystring = "┃barfoobarexample┃"

if any(regex.match(mystring) for regex in regexes):
    print('matched!')

How can I match this with regEx? I thought something like re.compile("*foo*"). Apparently the special characters won't match, because when I remove them, it works.

0 Answers0