vim中对调某特定字符两边的内容

如如下文本:
awerawedaew -> brthrtywertqwe aoyuilyilyi -> bsdfasfweghtyh asdfasdfasef -> basdfasdf
应用:
:%s/\(.*\) -> \(.*\)/\2 -> \1
结果:
brthrtywertqwe -> awerawedaew bsdfasfweghtyh -> aoyuilyilyi basdfasdf -> asdfasdfasef
\( \) :组 \1 :引用

Labels: , , ,

2009/04/26 10:46:00 PM  By Lao | License:by-nd/3.0 | 繁體  English | 0 Comments

Add a comment to this post  //  Subscribe Comments

Loading Comments...