iainemsley wrote:
> for scene in text.split('Scene'):
>     num = re.compile("^\s\[0-9, i{1,4}, v]", re.I)
>     textNum = num.match(scene)

Not related to your problem, but to your code - I'd write this as follows:

        match_scene_num = re.compile("^\s\[0-9, i{1,4}, v]", re.I).match

        for scene_section in text.split('Scene'):
            text_num = match_scene_num(scene_section)

This makes the code more readable and avoids unnecessary work inside the loop.

Stefan
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to