Re: multiline regular expression (replace)

2007-05-30 Thread Zdenek Maxa
Hi, Thanks a lot for useful hints to all of you who replied to my question. I could easily do now what I wanted. Cheers, Zdenek Holger Berger wrote: > Hi, > > yes: > > import re > > a=""" > I Am > Multiline > but short anyhow""" > > b="(I[\s\S]*line)" > > print re.search(b, a,re.MULTILINE).gro

Re: multiline regular expression (replace)

2007-05-29 Thread Holger Berger
Hi, yes: import re a=""" I Am Multiline but short anyhow""" b="(I[\s\S]*line)" print re.search(b, a,re.MULTILINE).group(1) gives I Am Multiline Be aware that . matches NO newlines!!! May be this caused your problems? regards Holger Zdenek Maxa wrote: > [EMAIL PROTECTED] wrote:

Re: multiline regular expression (replace)

2007-05-29 Thread Gerard Flanagan
On May 29, 11:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote: > Hi all, > > I would like to perform regular expression replace (e.g. removing > everything from within tags in a XML file) with multiple-line pattern. > How can I do this? > > where = open("filename").read() > multilinePattern = "^

Re: multiline regular expression (replace)

2007-05-29 Thread vbr
> Od: Zdenek Maxa <[EMAIL PROTECTED]> > Předmět: Re: multiline regular expression (replace) > Datum: 29.5.2007 13:46:32 > > [EMAIL PROTECTED] wrote: > > On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote: > >

Re: multiline regular expression (replace)

2007-05-29 Thread Steve Holden
Zdenek Maxa wrote: > [EMAIL PROTECTED] wrote: >> On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote: >> >>> Hi all, >>> >>> I would like to perform regular expression replace (e.g. removing >>> everything from within tags in a XML file) with multiple-line pattern. >>> How can I do this? >

Re: multiline regular expression (replace)

2007-05-29 Thread Zdenek Maxa
[EMAIL PROTECTED] wrote: > On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote: > >> Hi all, >> >> I would like to perform regular expression replace (e.g. removing >> everything from within tags in a XML file) with multiple-line pattern. >> How can I do this? >> >> where = open("filename"

Re: multiline regular expression (replace)

2007-05-29 Thread half . italian
On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote: > Hi all, > > I would like to perform regular expression replace (e.g. removing > everything from within tags in a XML file) with multiple-line pattern. > How can I do this? > > where = open("filename").read() > multilinePattern = "^ <

multiline regular expression (replace)

2007-05-29 Thread Zdenek Maxa
Hi all, I would like to perform regular expression replace (e.g. removing everything from within tags in a XML file) with multiple-line pattern. How can I do this? where = open("filename").read() multilinePattern = "^ <\/tag>$" re.search(multilinePattern, where, re.MULTILINE) Thanks great