I have the following regular expression
(?<=<TEXT>).*?(?=</TEXT>)
which is supposed to find anything between <TEXT>
and </TEXT>
.
I paste my string on http://pythex.org/ and it does work, but the following implementation in python does not find anything
import re
re.findall(r'(?<=<TEXT>).*?(?=</TEXT>)', text)
where text
contains what I pasted into the window there (used the debugger, pasted output of variable). Do I need to pay attention to something special?
Some additional output
>>> pattern = re.compile(r"(?<=<TEXT>).*?(?=</TEXT>)")
>>> print(pattern)
re.compile('(?<=<TEXT>).*?(?=</TEXT>)')
>>> re.DOTALL
16
>>> pattern.findall(text)
[]