Pattern item `\@>', :h /\@>

IMHO, `\@>' is almost useless.  Example: try to only match an odd number
of backslashes before what follows in the text.
Pattern (b = backslash-pattern, w = what-follows-pattern):
    \%(b\%(bb\)*\)\@>w

This pattern does not work as intended -- it still matches within an
even number of backslashes, as it retries with shorter matches (shorter
match starts after the first `b' in the text below).  Eg
... bbbbw
...  ^^^^ <- possible unintended match

What's needed: when `\%(...\)\@>' succeeds, a retry (in case the whole
pattern fails) must start *after the end* of its match (not one
character to the right), just like as if it was a successfully processed
match (eg in a substitute command).

Notes
* `\@>' could be interesting to avoid the slow `\@<!' item
* Why does the example in the help `\%(a*\)\@>a' work?
  Because each retry (of `\%(a*\)\@>') with shorter match fails too.

--
Andy

--
--
You received this message from the "vim_dev" 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

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui