public override int Matches(int stringIndex, String testString, MatchResultImpl matchResult) { if (matchResult.Mode() == Matcher.MODE_FIND || stringIndex == matchResult.GetRightBound()) { matchResult.SetValid(); matchResult.SetEnd(0, stringIndex); return(stringIndex); } return(-1); }