Undocumented regex behaviour in re module

Matthias Huening matthias.huening at univie.ac.at
Wed Jul 5 04:21:56 EDT 2000


What about a simple regex and the use of string.split()?

--------------

tags = re.compile(r"<\?(.+)\?>", re.I | re.M)
match = tags.search(text)
while match:
    print text[match.start():match.end()], \
          '=>', string.split(match.group(1))
    match = tags.search(text, match.end())

--------------


Matthias

- - - - -
matthias.huening at univie.ac.at
http://www.ned.univie.ac.at/










More information about the Python-list mailing list