匹配到“藏文:”后面的藏文,不包括逗号。
------解决思路----------------------
范围写错了,应该是\u0f00-\u0fc6。
------解决思路----------------------
如果要保存匹配结果需这样写:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
public class Test {
public static void main(String[] args) {
try {
String subjectString = "?????????????????????????????????????????????";
Pattern regex = Pattern.compile("\\p{IsTibetan}+", Pattern.MULTILINE);
Matcher regexMatcher = regex.matcher(subjectString);
while (regexMatcher.find()) {
for (int i = 0; i <= regexMatcher.groupCount(); i++) {
System.out.println("resutl=" + regexMatcher.group(i));
}
}
} catch (PatternSyntaxException ex) {
// Syntax error in the regular expression
}
}
}