LoginSignup
1

More than 5 years have passed since last update.

Vim の置換で正規表現の後方参照

Posted at

\(\) でキャプチャして(エスケープが必要)、\1, \2, ... で参照できます。

例えば Array<Foo> などを Foo[] の形式にしたいときは:

:%s/Array<\([^>]*\)>/\1[]/g

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1