Use backreferences.
%s/",(\s\d)\t/",\1))/gc
Here, (\s\d)
is a capture group. The \1
refers to the capture group.
Question
When I was using VIM, I got a simple question:
Replace the pattern ",\s\d\t))
with ",\s\d))
.
For example:
Change the following
...roid", 1 ));
...id", 0 ));
...lite", 1 ));
...
To
...roid", 1));
...id", 0));
...lite", 1));
...
I tried %s/",\s\d\t/",\s\d))/gc
, but it changed them to ...roid",sd));
Solution
Use backreferences.
%s/",(\s\d)\t/",\1))/gc
Here, (\s\d)
is a capture group. The \1
refers to the capture group.