void () { RegexFacade regex = RegexFacade.regex("[0-9]+"); byte[] stringBytes = "12:00pm".getBytes(StandardCharsets.UTF_8); Searcher searcher = regex.searcher(stringBytes); assertTrue(searcher.search()); MatchData matchData = searcher.getCurrentMatchData(); assertEquals(1, matchData.count()); assertEquals(new TextMateRange(0, 2), matchData.codePointRange(stringBytes)); assertTrue(searcher.search()); matchData = searcher.getCurrentMatchData(); assertEquals(1, matchData.count()); assertEquals(new TextMateRange(3, 5), matchData.codePointRange(stringBytes)); assertFalse(searcher.search()); assertEquals(-1, searcher.getCurrentCharPosition()); }