java.util.regex.Matcher.groupCount() 方法
描述
java.time.Matcher.hasTransparentBounds() 方法查询此匹配器的区域边界的透明度。
声明
以下是 java.time.Matcher.hasTransparentBounds() 方法的声明。
public boolean hasTransparentBounds()
返回值
如果此匹配器使用透明边界,则为 true,否则为 false。
示例
下面的例子展示了 java.time.Matcher.hasTransparentBounds() 方法的用法。
package com.tutorialspoint;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MatcherDemo {
private static String REGEX = "(a*b)(foo)";
private static String INPUT = "aabfooaabfooabfoob";
public static void main(String[] args) {
Pattern pattern = Pattern.compile(REGEX);
// get a matcher object
Matcher matcher = pattern.matcher(INPUT);
System.out.println("hasTransparentBounds(): " + matcher.hasTransparentBounds());
}
}
让我们编译并运行上面的程序,这将产生以下结果 −
hasTransparentBounds(): false

