/** * 实现<code>MatchResult</code>接口, 取得指定group末尾相对于整个匹配的位移量. * * @param group group号, 0代表整个匹配 * @return 指定group末尾相对于整个匹配的位移量, 如果指定group不存在或未匹配, 则返回-1, 被匹配的字符串长度为0, * 则返回起始位移量 */ public int end(int group) { return result == null ? -1 : result.end(group); }
public int end(int arg0) { return mr.end(arg0); }
MatchResult result = matcher.getMatch(); buffer = new StringBuffer(); buffer.append(input.substring(result.beginOffset(0) + result.end(0))); logger.debug("Matched! Invoking match closure..."); expectContext = invokeClosure(regExpMatch, input, result);