vim 把括弧內的東西都置換掉 - Linux

Table of Contents

各位先進好,

我有兩個關於vim的問題:

1. 如何把被括弧 () 括住的字統統置換掉?

比方說 (test) (nonsense) -> (replacement) (replacement)

2. 如何把括弧本身也置換掉?

比方說 (test) (nonsense) -> replacement replacement


謝謝

--

All Comments

Aaliyah avatarAaliyah2008-06-04
try REGEXP 不過在vim裡怎麼用我不曉得 XD
Oliver avatarOliver2008-06-09
:%s:\([a-z]\+\):test:g ....試了很久XD
Robert avatarRobert2008-06-13
:s:(\w\+):replacement: 這是2
:s:\(\w\+\):replacement: 這是1
Kristin avatarKristin2008-06-13
Damian avatarDamian2008-06-17
多謝, 我要花點時間消化:P