0
我正在尋找正則表達式來從文本文件中刪除電子郵件地址。Vim正則表達式來替換標籤
輸入文件:
Hannah Churchman <[email protected]>; Julie Drew <[email protected]>;
輸出文件:(。*?)
Hannah Churchman; Julie Drew;
我想到了一個通用的正則表達式shuch爲S/<> // g ^將是一個很好的起點,但我無法找到使用Vim的正確表達式?
像
:%s/ <\(.*?\)>//g
不起作用。錯誤是「E486:找不到模式:」。
:%s#[^ <]*>##g almost works but it leaves the space and < behind.
:%s# <##g to remove the " <" remaining stuff.
有關如何更好地製作此命令的任何提示?
'*'是不是在VIM非貪婪的比賽,看到http://stackoverflow.com/a/1305957/155299 – 2012-04-16 15:16:07