[Solved] Regular expression to convert an RGB string to an RGBa string


Sure you can:

    inputString.replaceFirst("rgb\\((\\d++),\\s*(\\d++),\\s*(\\d++)\\)", "rgba($1,$2,$3,255)");

If you use it more often, better pre-compile the regex with Pattern.compile().

0

solved Regular expression to convert an RGB string to an RGBa string