A.J.Mechelynck [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
Bill McCarthy wrote:
On Thu 30-Nov-06 11:49pm -0600, Peter Hodge wrote:
--- Bill McCarthy wrote:
On Thu 30-Nov-06 10:24pm -0600, Peter Hodge wrote:
--- Bill McCarthy wrote:
On Thu 30-Nov-06 9:20pm -0600, Peter Hodge wrote:
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
To generalize to the n-th occurrence: (put the qty of skipped matches in N)
All,
I am puzzled by a slightly more complicated version:
how to match a '%' character following the 2nd occurrence of home?
--Matt
On Fri, Dec 01, 2006 at 09:09:17AM -0500, Charles E Campbell Jr wrote:
Peter Hodge wrote:
Try:
/^.\{-}home.\{-}\zshome
for your reference:
[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%
where N is 1 for the 2nd occurrence (N is 2 for the third occurrence,
etc).
This pattern
On Fri 1-Dec-06 1:59am -0600, A.J.Mechelynck wrote:
He gave it. In the above case, you highlight not only the 2nd occurrence but
also the 4th, 6th, etc.
Of course. I was so focused on (1) the second on the line
and (2) the shortest match first algorithm of non-greedy
constructs (which
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
[EMAIL PROTECTED] wrote:
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?
On 12/1/06, Bill McCarthy [EMAIL PROTECTED] wrote:
One might think so, but also note:
:help non-greedy
I don't have tag 'non-greedy' in the help. I have vim 7.9.164
from svn. Where do I get more updated helpfiles ?
Yakov
On 12/2/06, Yakov Lerner [EMAIL PROTECTED] wrote:
On 12/1/06, Bill McCarthy [EMAIL PROTECTED] wrote:
One might think so, but also note:
:help non-greedy
I don't have tag 'non-greedy' in the help. I have vim 7.9.164
7.0.164, sorry, not 7.9.164. Still, where do I get more updated
Yakov Lerner wrote:
On 12/1/06, Bill McCarthy [EMAIL PROTECTED] wrote:
One might think so, but also note:
:help non-greedy
I don't have tag 'non-greedy' in the help. I have vim 7.9.164
from svn. Where do I get more updated helpfiles ?
Yakov
By ftp:
On Fri 1-Dec-06 7:19pm -0600, Yakov Lerner wrote:
On 12/1/06, Bill McCarthy [EMAIL PROTECTED] wrote:
One might think so, but also note:
:help non-greedy
I don't have tag 'non-greedy' in the help. I have vim 7.9.164
from svn. Where do I get more updated helpfiles ?
I see Tony already
On Thu 30-Nov-06 6:31pm -0600, zzapper wrote:
Hi given a sample text below
home
home gg home xxx
home ggg ggg home home
home home
How do you match JUST the second home in any of the above lines (ie avoid
greediness)
/home.\{-}\zshome
--
Best regards,
Bill
Hello,
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
regards,
Peter
--- zzapper [EMAIL PROTECTED] wrote:
Hi given a sample text below
home
home gg home xxx
home
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,
--- 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
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
--- Bill McCarthy [EMAIL PROTECTED] wrote:
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
On Thu 30-Nov-06 11:49pm -0600, Peter Hodge wrote:
--- Bill McCarthy wrote:
On Thu 30-Nov-06 10:24pm -0600, Peter Hodge wrote:
--- Bill McCarthy wrote:
On Thu 30-Nov-06 9:20pm -0600, Peter Hodge wrote:
Try:
/^.\{-}home.\{-}\zshome
for your reference:
\{-} makes the '.' match as
Am I the only one amused that /homeCRn does nearly the same thing?
I mean, I suppose you could be doing operations on your search but
couldn't you equally just ayw and do stuff there? Besides \{-}\zs
takes too long to type :)
-Original Message-
From: Bill McCarthy [mailto:[EMAIL
Bill McCarthy wrote:
On Thu 30-Nov-06 11:49pm -0600, Peter Hodge wrote:
--- Bill McCarthy wrote:
On Thu 30-Nov-06 10:24pm -0600, Peter Hodge wrote:
--- Bill McCarthy wrote:
On Thu 30-Nov-06 9:20pm -0600, Peter Hodge wrote:
Try:
/^.\{-}home.\{-}\zshome
for your reference:
\{-} makes
20 matches
Mail list logo