On Thu 30-Nov-06 10:24pm -0600, you wrote:

> --- Bill McCarthy <[EMAIL PROTECTED]> wrote:

>> On Thu 30-Nov-06 9:20pm -0600, Peter Hodge wrote:
>> 
>> > Try:
>> >
>> >   /^.\{-}home.\{-}\zshome
>> >
>> >
>> > for your reference:
>> >
>> >   \{-} makes the '.' match as little as possible
>> >   \zs makes the search match begin at this point in the pattern
>> 
>> One might think so, but also note:
>> 
>>     :help non-greedy
>> 
>> In particular, ready the sentence starting with "BUT".  All
>> that is needed is:
>> 
>>     /home.\{-}\zshome
>> 
>> Earliest is preferred to shortest.

> Yes, but that could also match a 3rd or 4th or 5th occurance of 'home' in one
> line, so it's slightly safer to anchor the pattern to the start of the line.

Given the use of the "shortest match first algorithm" I
don't see how that's possible.  Please give an example.

-- 
Best regards,
Bill

Reply via email to