Ver originalString text = "palabra12345"; Pattern pattern = Pattern.compile("\\d+$");Matcher matcher = pattern.matcher(text); if (matcher.find()) { text = matcher.replaceFirst("");} System.out.println(text);