java中intcount什么意思_intgroupCount()
int groupCount()
描述 (Des对未来规划
cription)
java.upCount()⽅法返回此匹配结果漂亮的英文单词
模式中的捕获组数。
声明 (Declaration)
以下是java.time.MatchResult.提审
groupCount()⽅法的声明。int groupCount()
返回值 (Return Value)
此匹配器模式中的捕获组数。
例⼦ (Example)
以下⽰例显⽰了java.鸡雏
upCount()⽅法的⽤法。package com.iowiki;
import MatchResult;
import Match英语语法网
e医院自我鉴定
r;
import Pattern;
public class MatchResultDemo {
private static final String REGEX = "(.*)(\\d+)(.*)";
private static final String INPUT = "This is a sample 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 resul双十一提前购
t = MatchResult();
//Prints the number of capturing groups in this match result's pattern.
System.out.println("Capturing Groups: "+upCount());
}
}
}
让我们编译并运⾏上⾯的程序,清汤鱼
这将产⽣以下结果 -First Capturing Group - Match String: This is a sample Text, 1234, with numbers in between.