Hello, I am trying to extract a list of strings from a text. I am looking it for hours now, googling didn't help either. Could you please help me?
>>>s = """ >>>\n<organisatie>\n<Profiel_Id>28996</Profiel_Id>\n</organisatie>\n<organisatie>\n<Profiel_Id>28997</Profiel_Id>\n</organisatie>""" >>> regex = re.compile(r'<organisatie.*</organisatie>', re.S) >>> L = regex.findall(s) >>> print L ['organisatie>\n<Profiel_Id>28996</Profiel_Id>\n</organisatie> \n<organisatie>\n<Profiel_Id>28997</Profiel_Id>\n</organisatie'] I expected: [('organisatie>\n<Profiel_Id>28996</Profiel_Id>\n</organisatie> \n<organisatie>), (<organisatie>\n<Profiel_Id>28997</Profiel_Id>\n</ organisatie')] I must be missing something very obvious. Greetings Arjen -- http://mail.python.org/mailman/listinfo/python-list