On Fri, Dec 01, 2006 at 10:34:14AM -0500, Charles E Campbell Jr wrote:
> [EMAIL PROTECTED] wrote:
> 
> >I am puzzled by a slightly more complicated version:
> >     how to match a '%' character following the 2nd occurrence of "home"?
> > 
> >
> /^.\{-}\%(home.\{-1,}\)\{N}home.\{-}\zs%

This pattern doesn't work. Try it on this line:
"home home home home home home% home"

It should match nothing on that line, because the '%' doesn't follow the
2nd occurrence as desired.

--Matt

> 
> where N is 1 for the "2nd occurrence" (N is 2 for the third occurrence, 
> etc).
> 
> This pattern matches up to and including the 2nd home, extends past a 
> minimal amount of anything up to but not including a %, whereupon the 
> pattern matching starts.
> 
> Regards,
> Chip Campbell
> 

Reply via email to