Is it possible to return the line number of regex findall method results in Python?
import re
s="""The
quick
brown
fox
jumps
over
the
lazy
dog
"""
print re.findall('the', s, flags=re.IGNORECASE | re.MULTILINE)
Expected Result: Will return line 1 and 7.
Is this possible without reading the text line by line?
Thanks in advance.