Re: [Tutor] extend my re

2008-11-22 Thread Mark Tolonen
"Ricardo Aráoz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I've got a half working re but I can't find a way to give it the final touch. Let's say I have (it would actually be source code file) : import re MyString = """Algo ... Start ... otro ... comment ...

Re: [Tutor] extend my re

2008-11-22 Thread Ricardo Aráoz
Marco Catunda wrote: > Ricardo, > > Try this pattern > > MyPattern = > re.compile(r'(.*?Start.*?)((^.*?comment.*?)*)(^.*?comment)(.*?end)', > re.S | re.M ) > > Almost did it. But if there was something after and in the same line of the "comment" I want commented it wouldnt be taken. from :

[Tutor] extend my re

2008-11-22 Thread Ricardo Aráoz
Hi, I've got a half working re but I can't find a way to give it the final touch. Let's say I have (it would actually be source code file) : >>> import re >>> MyString = """Algo ... Start ... otro ... comment ... otro ... comment ... comment ... otro ... end ... """ >>>