I'm trying to write a regex that finds times at the beginning of a string. I want to remove that part of the string so I'm using the regioEnd function but it sets the regioend to the end of the line.
Pattern pattern = Pattern.compile("\\d+.\\d+");
String line = "4:12testline to test the matcher!";
System.out.println(line);
Matcher matcher = pattern.matcher(line);
int index = matcher.regionEnd();
System.out.println(line.substring(index));
What am I doing wrong here?