Vim tips

less than 1 minute read

찾아 바꾸기 (find replace)

abcd1234
:%s/\(abcd\)/\(1234\)/\2\1/g
1234abcd

:%s/\(1234\)/\(abcd\)/\=printf("[%05d%6.6s]", submatch(1), submatch(2))/g
[01234abcd  ]

Tags: , ,

Categories:

Updated:

Comments