I have a question. I am trying to get a certain string between two substrings from a text file.
The text file is larger, but part of it contains this:
r\n[url=asitename][/url]\r\n[url=x]hello[/url]\r\n[url=x]a text[/url]\r\n[url=n]test[/url]\r\n\ttest
\r\n\t\t\r\n\t\twarn user\r\n\t\r\n\t2\r\n\t02-06-2017, 01:44 am
by cinccino. end: modcp_reports_report -->
Now, I am interested in the text next between 'asitename' and 'end:'
I would like to get the text between those strings.
I have tried this:
lookup = 'asitename'
myFileread = myFile.read()
re.search(lookup+'(.*)end', myFileread).group(1)
However, it returns the following error:
AttributeError: 'NoneType' object has no attribute 'group'
I am confused as to why this is not working. It works with more simple strings.