On Jul 7, 8:04 pm, "John Beckett" <[email protected]> wrote:
> Edward Beach wrote:
> > I'm trying to return a string filtered from output generated
> > by an external application. The string in question is
> > proceeded by "Label:\t" so here's my attempt:
>
> > :echo matchstr(system("<command>"), '\nLabel:\s\+\(\S\+\)\n')
>
> > but it returns the entire line; how can I isolate the unknown
> > string in \( \) ?
>
> Using \zs to start the search is easiest. Assuming the string is
> restricted to one line, the following pattern should work:
>
>     ^Label:\s\+\zs.*
>
> John

The \zs and the \ze seem to be the trick here.

Thanks!


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

Reply via email to