java中intcount什么意思_intgroupCount()
int groupCount()
描述 (Description数学体系
)
java.upCount()⽅法返回此匹配结果模式中的捕获组数。
声明 (Declaration)
以下是java.upCount()⽅法的声明。int gro江苏高考作文题目
upCount()
返回值 (Return Value)
此匹配器模式中的捕获组数。
例⼦ (Example)
以下⽰例显⽰了java.upCount()⽅法的⽤法。package com.iowiki;
import MatchResult;
import Matcher;
import Pattern;
public class MatchResultDemo {
private static final String REGEX = "(.*)(\\d+)(.*嘴甜
)";
private static final String INPUT = "This is a sa女人命苦的面相图片
mple Text, 1234, with numbers in between.";
public static void main(String[] args) {
// create a pattern
Pattern pattern = pile(REGEX);
// get a matcher object
Matcher matcher = pattern.matcher(INPUT);
if(matcher.find()) {
/
/get the MatchResult Object
MatchResult result = MatchResult();
//Prints the number of capturing groups in this match 顶字笔顺
result's pattern.
System.out.println楔形
("Capturing Groups: "+resu道的成语
lt.groupCount());
}
}
}
让我们编译并运⾏上⾯的程序,这将产⽣以下结果 -First Capturing Group - Match String: This is a sample Text, 1234, with numbers in between.