"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
...
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 :
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
... """
>>>