command
|
description
|
:%s/ */ /g
|
Replace many spaces to one space
|
:%s/ *$//
|
Delete the spaces of the tail
|
:%s/^/ /
|
Add a space on every line
|
:%s/^[0-9][0-9]* //
|
Delete the number on the head of every line
|
:%s/b[aeio]g/bug/g
|
Replace all the “bag,beg,big,bog” for “bug”
|
:%s/t/([aou]/)g/h/1t/g
|
replace all the “tag,tog,tug” for “hat,hot,hug”
|
Meta
|
Description
|
.
|
Any one character; eg: r.t – rat, rut, …
|
$
|
Line end; eg: job$
|
^
|
Line start: eg: ^I
|
*
|
0 or many characters before it; eg: a*
|
/
|
quote
|
[]
|
Any one in the
bracket
; eg [A-Za-z]
|
/(/)
|
group
|
|
|
Logic or; eg
: (he|her)
|
+
|
One or many character before it; eg:9+
|
?
|
0 or 1 character before it; eg: 9?
|