Re: Confused about 'positive lookbehind assertion'

2007-09-26 Thread Duncan Booth
"Andrew Durdin" <[EMAIL PROTECTED]> wrote: > On 9/25/07, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: >> >> Any idea what this positive lookbehind achieves which can't be done >> without it. >> I remember cases where positive look-ahead is useful. >> >> In the above example, r.search('abcdef') does

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Andrew Durdin
On 9/25/07, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > > Any idea what this positive lookbehind achieves which can't be done > without it. > I remember cases where positive look-ahead is useful. > > In the above example, r.search('abcdef') does the job of ensuring > 'def' is preceded by 'abc'.

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Karthik Gurusamy
On Sep 25, 8:01 am, Erik Jones <[EMAIL PROTECTED]> wrote: > On Sep 24, 2007, at 9:38 PM, Robert Dailey wrote: > > > Hi, > > > I've been reading the python documentation on 'positive lookbehind > > assertion' and I don't understand at all how it works. The python > > docs give the following example:

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Erik Jones
On Sep 24, 2007, at 9:38 PM, Robert Dailey wrote: > Hi, > > I've been reading the python documentation on 'positive lookbehind > assertion' and I don't understand at all how it works. The python > docs give the following example: > > " (?<=abc)def will find a match in "abcdef", since the look

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Robert Dailey
I think I get it... it's really just a way (so it seems) to make characters get added to the found groups as they're matched. Thanks for your help. On 9/25/07, Andrew Durdin <[EMAIL PROTECTED]> wrote: > > On 9/25/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I've been reading the py

re: Confused about 'positive lookbehind assertion'

2007-09-24 Thread Robert Dailey
Hi, I've been reading the python documentation on 'positive lookbehind assertion' and I don't understand at all how it works. The python docs give the following example: "**(?<=abc)def will find a match in "abcdef", since the lookbehind will back up 3 characters and check if the contained pattern