I'm switching from Emacs to VIM for a variety of reasons. One thing that I can't seem to figure out how to do is perform a substitution using a regular expression with captures. What I have is:
What I want is:
I think it would be easy using a command like
%s/^\(\d+,\)\(\d+,\)\d+,\(\d+\)$/\1\2\3/, but all I get is the error message "Pattern not found." Looking at the VIM help the syntax looks right and I've made sure that magic is set. So I don't know what's going wrong.
What's wrong with my substitution?
Update: Fixed typos in the post that weren't used in VIM.