import re
import urllib.request
file_txt = urllib.request.urlopen("ftp://ftp.sec.gov/edgar/data/1408597/0000930413-12-003922.txt")
pattern_item4= re.compile("(Item\\n*\s*4.*)Item\\n*\s*5")
print(re.search(pattern_item4,bytes.decode(f)))
#Returns None
This regex returns what I want in rubular, but obviously it doesn't do what is expected in Python. Would anyone help me abit with this. The intention of the regex is to basically extract stuff between item4 and item5.
Thank you

\\n*it don't have effect. It must be:[\n]*(or[\\n]*depending as you pass this string).file_txt? Also where does thefcome from inbytes.decode(f)?