I have this image copy method that uses the name of the image being copied for the new version. If I am copying the same image often it will add (integer) behind the image name: like image.jpg becomes image(1).jpg. Now I am trying to use regex to replace the (int) part but I am not quite getting how to do it.
imageName.replaceAll(["(]\\d[)]","");
But does this only delete (1) but not if there were like two digits (12)?