Friday, May 23, 2008

vim token regular expression

When you use the regular expression in Vim, you probably want to cite the search results in the replaced pattern. Followed is one of the solution.

%s/\(\n\d\+\n\)/^M\1/g
\1 represent the searching content in (), you can put the second () after the first one.

No comments: