problem with re.MULTILINE

Necronymouse necronymouse at gmail.com
Sun Oct 18 20:28:57 CEST 2009


Hello i ´ve got a little problem: I ´ve this text:
http://openpaste.org/en/secret/17343/pass-python and I need to parse
it. So i wrote this:

>>>
patternNode = re.compile("""
# Node (\w*).*
(.*)""", re.MULTILINE)


with open("test.msg", "r") as file:
    testData = file.read()

for Node in re.findall(patternNode, testData):
    print "Node:", Node[0]
    print Node
<<<

but it prints only one line from text. If i am using re.DOTALL it
wouldn´t print anything.. So don´t you know whre the problem is?

Sorry for my English - it´s not my native language...



More information about the Python-list mailing list