java.time.Matcher.hasTransparentBounds()
方法查詢此匹配器的區域邊界的透明度。
聲明
以下是java.time.Matcher.hasTransparentBounds()
方法的聲明。
public boolean hasTransparentBounds()
返回值
如果此匹配器使用透明邊界,則返回true
,否則返回false
。
示例
以下示例顯示了java.time.Matcher.hasTransparentBounds()
方法的用法。
package com.zaixian;
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