Let\'s say you have some lines that look like this
1 int some_function() { 2 int x = 3; // Some silly comment
And so on. The indentation i
In some regex flavors, you can use a lookbehind:
s/(?<=^ *) / /g
In all other flavors, you can reverse the string, use a lookahead (which all flavors support) and reverse again:
s/ (?= *$)/ /g