On Apr 7, 9:00 am, "J.A.J. Pater" <[email protected]> wrote:
> I don't know if it's OK to ask questions like these on this list, but
> could someone tell me what this line means:
> matchstr(getline('.'), '\\\(no\)\?bibliography{\zs.\{-}\ze}')
>
> I understand the matchstr and getline part but not the ('.'),
> '\\\(no\)\?bibliography{\zs.\{-}\ze}' part.
> It seems to be a regex but how is it build up?
The `.' is the line number argument to getline(). It refers to the
current line.
:help getline()
The regex is looking for things like...
\nobibliography{SOMESTUFF}
and
\bibliography{SOMESTUFF}
...in the current line, and if found, the \zs and \ze ensure that only
SOMESTUFF is considered to be part of the match.
:help /\?
:help /\zs
:help /\ze
:help /\{-
Brett S.
>
> Thanks in advance.
>
> Adriaan.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---