Vim Regex Replace

Viewed 29728

I think this is a pretty simple solution but I have been trying to find an answer for about an hour and can't seem to figure it out.

I'm trying to do a find/replace in Vim that would replace a series of numbers that begin with 103 and are followed by four digits to 123 followed by the same four digits, as such:

1033303 -> 1233303
1033213 -> 1233213

The closest I have come is this:

%s/103\d\{4}/123\0/g

However this results in the entire number being matched by the \0, as such:

1033303 -> 1231033303

Thank you very much for any help

4 Answers
Related