Re: [Tutor] Newbie - regex question

2010-08-31 Thread Sam M
Thanks everyone for prompt response and explanation. Cheers! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Newbie - regex question

2010-08-30 Thread Marc Tompkins
On Mon, Aug 30, 2010 at 2:56 PM, Hugo Arts wrote: > To solve, we have the non-greedy patterns. They eat not as much > possible, but as little as possible. To make a qualifier non-greedy, > simply add an asterix at its end: > > r'WORD1-.*?' > > I would also like to offer one small correction: an a

Re: [Tutor] Newbie - regex question

2010-08-30 Thread Hugo Arts
On Tue, Aug 31, 2010 at 12:02 AM, Serdar Tumgoren wrote: >  To make a qualifier non-greedy, >> >> simply add an asterix at its end: >> >> r'WORD1-.*?' >> > > Hugo explains this nicely, but I just wanted to make one minor correction >  -- the non-greedy qualifier is the question mark AFTER an the a

Re: [Tutor] Newbie - regex question

2010-08-30 Thread bob gailer
On 8/30/2010 4:52 PM, Sam M wrote: Hi Guys, I'd like remove contents between tags that matches pattern "WORD1" as follows: Change "stuff word1-emai...@domain.com more stuff word1-emai...@domain.com still more stuff word2-emai...@domain.com stuff after WORD2 word1-emai...@domain.com" To

Re: [Tutor] Newbie - regex question

2010-08-30 Thread Serdar Tumgoren
To make a qualifier non-greedy, > simply add an asterix at its end: > > r'WORD1-.*?' > > Hugo explains this nicely, but I just wanted to make one minor correction -- the non-greedy qualifier is the question mark AFTER an the asterisk (which is what Hugo's code shows but I believe he accidentally

Re: [Tutor] Newbie - regex question

2010-08-30 Thread Hugo Arts
On Mon, Aug 30, 2010 at 10:52 PM, Sam M wrote: > Hi Guys, > > I'd like remove contents between tags that matches pattern "WORD1" > as follows: > > Change > "stuff word1-emai...@domain.com more stuff > word1-emai...@domain.com still more stuff > word2-emai...@domain.com stuff after WORD2 > word1-e

[Tutor] Newbie - regex question

2010-08-30 Thread Sam M
Hi Guys, I'd like remove contents between tags that matches pattern "WORD1" as follows: Change "stuff word1-emai...@domain.com more stuff word1-emai...@domain.com still more stuff word2-emai...@domain.com stuff after WORD2 word1-emai...@domain.com" To "stuff more stuff still more s