tobiah wrote:
>>>Posted via a free Usenet account from http://www.teranews.com
>>
>>Its all about context. If you want to match something but only if it
>>precedes something else, then you follow the regular expression for
>>'something' by the regular expression for 'something else' where
>>`someth
Paddy wrote:
> tobiah wrote:
> > >> Posted via a free Usenet account from http://www.teranews.com
> > > Its all about context. If you want to match something but only if it
> > > precedes something else, then you follow the regular expression for
> > > 'something' by the regular expression for 'som
tobiah wrote:
> Sorry, I should have tried harder. I see that the text
> of the match is simply not consumed, so that:
>
> m = re.search('(?=foo)fo', 'food')
>
> succeeds, while
>
> m = re.search('(?=fox)fo', 'food')
>
> does not.
They are more commonly used, and generally more useful
tobiah wrote:
> >> Posted via a free Usenet account from http://www.teranews.com
> > Its all about context. If you want to match something but only if it
> > precedes something else, then you follow the regular expression for
> > 'something' by the regular expression for 'something else' where
> >
>> Posted via a free Usenet account from http://www.teranews.com
> Its all about context. If you want to match something but only if it
> precedes something else, then you follow the regular expression for
> 'something' by the regular expression for 'something else' where
> `something else` is enc
On 2006-09-07, Paddy <[EMAIL PROTECTED]> wrote:
> tobiah wrote:
>> (?=...)
>> Positive lookahead assertion. This succeeds if the contained
>> regular expression, represented here by ..., successfully
>> matches at the current location, and fails otherwise. But,
>> once the contained expression has
tobiah wrote:
> (?=...)
> Positive lookahead assertion. This succeeds if the contained
> regular expression, represented here by ..., successfully
> matches at the current location, and fails otherwise.
> But, once the contained expression has been tried, the
> matching engine doesn't advance at a
Sorry, I should have tried harder. I see that the text
of the match is simply not consumed, so that:
m = re.search('(?=foo)fo', 'food')
succeeds, while
m = re.search('(?=fox)fo', 'food')
does not.
tobiah wrote:
> (?=...)
> Positive lookahead assertion. This succeeds if the c