62,620
社区成员
发帖
与我相关
我的任务
分享String s = "^[0-9]$";
Pattern pattern = Pattern.compile(s);
Matcher m = pattern.matcher("syhs");
boolean b = m.find();//判断是否匹配String SYHC = "8";//0-9
String s = "^[0-9]$";
Pattern pattern = Pattern.compile(s);
Matcher matcher = pattern.matcher(SYHC);
while (matcher.find()) {
System.out.println(matcher.group());
System.out.println("包含");
}