I am trying to write a regular expression that finds the time at the beginning of a line. I want to remove this part of the line, so I use the regioEnd function, but it sets 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?
ramin source share