On Friday, April 6, 2012 10:02:48 AM UTC+12, Ben Fritz wrote:
> Please give the EXACT command you ran...

Perhaps this script will illustrate:

    let s = '-2 3-4-5-6-7-8'
    let p = '\([0-9-]\@<!-\)\?\d[0-9]*'
    let [start, end] = [0, 0]
    while 1
        let start = match(s, p, end)
        let end   = matchend(s, p, end)
        if start == -1
            break
        endif
        echo s[start : end-1]
    endwhile

I get:

    -2
    3
    -4
    -5
    -6
    -7
    -8

It would appear that using the third parameter to match() and matchend(), the 
match is done as if on a substring starting at the parameter, so the look 
behind assertion does not see what's there in the original string.

This is unlike searching in a buffer; the look behind assertion does look 
behind the start position of the search. Rameo, is this what you're getting at?

Regards, John

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to