I couldn’t set a better title for the question but my problem is this:
given a line of the form :
int a,b,var1,var2;
I need to convert it to a line of the form
s(a);s(b);s(var1);s(var2);
so far I have this:
s/\b(\w)[,;]/s\(\1\);/g
but it only converts it to
int s(a);s(b);s(var1);s(var2);
I need to not see the int part. Can this be done using only one regex?
You can use a non catching part of your regular expression together with making it optional, as in the below example:
output