I have the following code in JAVA:
java.lang.String IDListLink = IDList.replaceAll("(\\d+)", "g$1");
What this does is:
It adds g in front of the digits.
Lets say I have this:
then it becomes
How can I change this code in way that it first checks if there is g infront of the digit and if there is no g prefix then add it to the digits as a prefix? But I want to do it in one line by using the power of regular expressions. I don't wanna add any if or for loop.
So if I have this:
I want to see:
but I don't want to see
Does this code already do it?