So I want a gvim or sed command which would insert a string (new_string) before the first match (//). For instance
Say the input is --> hi hola //Comment
Then the output expected is --> hi hola new_string //Comment
So basically I want to add a string just before the first occurence of //
. I tried the sed command
sed 's/\<\/\/\>/Really &/' file
However, this doesn't work for //
substring.