Monday, August 30, 2010

Re: Vim RE and lazy operator

Ответ на сообщение «Re: Vim RE and lazy operator»,
присланное в 22:10:16 30 августа 2010, Понедельник,
отправитель Christian Brabandt:

The problem is that you can have more then one quote before @. If there is more
then one quote then you will capture everything starting from the first quote,
test your regex with original string provided by caruso_g, but add the attribute
``class="Test"'' to <li> tag, it will return
Test">Support: <a href="email@example.com
This is not the desired behavior.

Текст сообщения:
> Hi ZyX!
>
> On Mo, 30 Aug 2010, ZyX wrote:
> > You are sure? Quick test:
> > :echo matchstr('"", "abc@def", ""', '"\zs.\{-}@.\{-}\ze"')
> >
> > should echo ``abc@def'', but echoes ``", "abc@def''.
>
> I am not sure, what you tested, but this works as expected:
> :echo matchstr('"abc@def"', '"\zs.\{-}@.\{-}\ze"')
>
> abc@def
>
>
> regards,
> Christian

No comments:

Post a Comment