Re: Non greedy regex

2006-12-14 Thread Maksim Kasimov
27; ) [EMAIL PROTECTED] wrote: > Can someone please explain why these expressions both produce the same > result? Surely this means that non-greedy regex does not work? > > print re.sub( 'a.*b', '', 'ababc' ) > > gives: 'c' >

Re: Non greedy regex

2006-12-14 Thread Thomas Nelson
the same > > result? Surely this means that non-greedy regex does not work? > > > > print re.sub( 'a.*b', '', 'ababc' ) > > > > gives: 'c' > > > > Understandable. But > > > > print re.sub( 'a.*?b&#

Re: Non greedy regex

2006-12-14 Thread Carsten Haese
On Thu, 2006-12-14 at 06:45 -0800, [EMAIL PROTECTED] wrote: > Can someone please explain why these expressions both produce the same > result? Surely this means that non-greedy regex does not work? > > print re.sub( 'a.*b', '', 'ababc' ) > > gives

Non greedy regex

2006-12-14 Thread tibetan . houdini
Can someone please explain why these expressions both produce the same result? Surely this means that non-greedy regex does not work? print re.sub( 'a.*b', '', 'ababc' ) gives: 'c' Understandable. But print re.sub( 'a.*?b', '', &