I\'m trying to get the last result of a match without having to cycle through .find()
Here\'s my code:
String in = \"num 123 num 1 num 698 num 19238
just use \Z - end of string mach
String in = "num 123 num 1 num 698 num 19238 num 2134"; Pattern p = Pattern.compile("num ([0-9]+)\\Z"); Matcher m = p.matcher(in); if (m.find()) { in = m.group(1); }