I’ve got a string:
doCall(valA, val.valB);
Using a regex in GVIM I would like to change this to:
valA = doCall(valA, val.valB);
How would I go about doing this? I use %s for basic regex search and replace in GVIM, but this a bit different from my normal usages.
Thanks
You can use this:
\venables “more magic” in regular expressions – not strictly necessary here but I usually use it to make the expressions simpler.<…>matches word boundaries and the in-between part matches the first parameter and puts it in the first capture group. The replacement uses\1to access that capture group and insert into the right two places.