Vim search pattern problem

iiuc the pattern

/\v(^.*$\n)(^.*$\n).*\zs(\1\2)+

should match only when a second pair of lines is found that exactly matches the first pair, however surprisingly it matches at:

www
#1677096716
www 6673 
#1677096716

Must be a bug in vim? Or what am i missing?

I cannot tell whether this is a bug, or we just misunderstand how it works, but the following seems to do what you want:

/\v(^.*$)\n(^.*$)\n\zs(\1$)\n(\2$)\n
1 Like