Regex passes in Rubular but not in Python
Question: 
    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

![enter image description here](http://i.stack.imgur.com/Gr5GF.png)


Answer: Try using raw strings

    
    
    re.compile (r"(Item\\n*\s*4.*)Item\\n*\s*5")
    

I would guess it has to do with your escaping of `\n`. But it's impossible to
tell without knowing exactly what it is you're expecting that to match.

