I have text I need to parse which has this pattern:
Lorem ipsum, baby shark, do do doo
Host: MyHostName
Blah, Blah
I am trying to isolate the line Host: MyHostName
In regex101 this regex works well (?<=Host:).*?(?=$)
but for some reason Python's re.findall()
keeps returning an empty list. I have tweaked it in several ways but I cannot seem to get it to work.
Is there something I am overlooking here???
(Note: I am using Python 3.6)
EDIT My code in context
import re
pattern = r'(?<=Host:)(.*)(?=$)'
data = """
Lorem Ipsum...
Host: MyHostName
"""
x = re.findall(pattern, data)