Friday, January 1, 2010

Re: Patterns, variables and strange behavior of some thing.

On Jan 1, 12:28 pm, Stahlman Family <brettstahl...@comcast.net> wrote:
> I believe you may have uncovered a bug. It can be demonstrated with an
> even simpler example...
> \(i\(.\)\)\@<=\2
> ...which will match just after an i followed by any character, even when
> the character following the i is not repeated: e.g., on the following
> line...
> iax ibx ic

Not a bug, unless I misunderstand. From :help /\@<= you can see:

The part of the pattern after "\@<=" and "\@<!" are checked for a
match first, thus things like "\1" don't work to reference \(\)
inside
the preceding atom. It does work the other way around:
Example matches ~
\1\@<=,\([a-z]\+\) ",abc" in "abc,abc"

It's documented, which makes it a "quirk" instead :-P

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: