popen поддерживается в Windows, см. здесь:
http://msdn.microsoft.com/en-us/library/96ayss4b.aspx
Если вы хотите, чтобы это была кросс-платформенная, поп-это путь.
Instead of .*
use .\{-}
.
%s/style=".\{-}"//g
Also, see :help non-greedy
Non greedy search in vim is done using {-} operator. Like this:
%s/style=".\{-}"//g
just try:
:help non-greedy
Я обнаружил, что хорошее решение этого типа вопросов:
:%!sed ...
(или perl, если хотите). IOW, вместо того, чтобы изучать особенности регулярных выражений vim, используйте инструмент, который вы уже знаете. Использование Perl сделало бы? модификатор работает, чтобы сделать совпадение не жадным.
G'day,
Vim's regexp processing is not too brilliant. I've found that the regexp syntax for sed is about the right match for vim's capabilities.
I usually set the search highlighting on (:set hlsearch) and then play with the regexp after entering a slash to enter search mode.
Edit: Mark, that trick to minimise greedy matching is also covered in Dale Dougherty's excellent book "Sed & Awk" (sanitised Amazon link).
Chapter Three "Understanding Regular Expression Syntax" is an excellent intro to the more primitive regexp capabilities involved with sed and awk. Only a short read and highly recommended.
HTH
cheers,