Subsitute question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Subsitute question

Bu Rak
Is there a single command to change following patterns at once?

%s/AAA/ZZZ/g
%s/aaa/zzz/g

Burak

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Subsitute question

Nikolay Aleksandrovich Pavlov
Ответ на сообщение «Subsitute question»,
присланное в 16:52:43 09 августа 2010, Понедельник,
отправитель Bu Rak:

%s/aaa/\=((tolower(submatch(0))==submatch(0))?('zzz'):('ZZZ'))/ig

Текст сообщения:
> Is there a single command to change following patterns at once?
>
> %s/AAA/ZZZ/g
> %s/aaa/zzz/g
>
> Burak

signature.asc (205 bytes) Download Attachment