Monday, August 30, 2010

Re: Vim RE and lazy operator

Ответ на сообщение «Re: Vim RE and lazy operator»,
присланное в 20:52:18 30 августа 2010, Понедельник,
отправитель Tom Link:

You are sure? Quick test:
:echo matchstr('"", "abc@def", ""', '"\zs.\{-}@.\{-}\ze"')
should echo ``abc@def'', but echoes ``", "abc@def''.

Текст сообщения:
> > You mean, non-greedy? For part after @ you can use non-greedy \{-1,}
> > instead of \+, but this will not help you with part before @. Here you
> > must just replace dot with [^"@].
>
> This one should work too:
> s/"\zs.\{-}@.\{-}\ze"/.../g

No comments:

Post a Comment