[Python-de] re-Spaesse
Bernhard Herzog
bh at intevation.de
Mit Apr 19 18:44:53 CEST 2006
Dinu Gherman <gherman at darwin.in-berlin.de> writes:
> >>> re.findall(re.compile("START.*END"), "foo START bar END foobar")
> ['START bar END']
> >>>
> >>> re.findall(re.compile("START.*END", re.X), "foo START bar \n END
> foobar")
> []
>>> re.compile("START.*END", re.S).findall("foo START bar \n END foobar")
['START bar \n END']
Ohne die Option re.S passt "." nicht auf ein Newline.
Bernhard
--
Intevation GmbH http://intevation.de/
Skencil http://skencil.org/
Thuban http://thuban.intevation.org/