Monday, August 30, 2010

Re: Vim RE and lazy operator

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

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 [^"@].

Текст сообщения:
> Hi there,
> is there a lazy operator for RE in Vim?
>
> I mean, I have the following code:
>
> <li>Support: <a href="email@example.com"
> title="email@example.com">email@example.com</a></li>
>
> and I tried to select just the text inside double quotes for
> substitutions using: %s/"\(.\+@.\+\)"/\1sometext/g
>
> Obviously, that select the whole text inside the first " on the row
> till the last one and not the second one as I would.
> Since I am just learning RE, I was wondering if does exist a lazy
> operator for Vim RE.
>
> Thank you all.

No comments: