Within a given line, I would like to search for a text and replace it with a different text at a specific column number within the same line. for example, I would like to replace,
port_a,
port_xyz,
with,
port_a (port_a),
port_xyz (port_xyz),
I understand we can use,
%s/\(\w\+\)/ (\1),/g
But, this will always give me 10 spaces (assuming I added 10 spaces in the command above) between the word and following '('.
But, I would like to have the '(' aligned at column number 10 on each line. Is there a way using regexp that I can achieve this, maybe, by specifying column number in the command?
I tried the command I specified above and manually align the '('. But, I would like to understand if there is an easier way to achieve this.