Pattern p=Pattern.compile("\\d+"); Matcher m=p.matcher("22bb23"); System.out.println(m.matches()); Matcher m2=p.matcher("2223"); System.out.println(m2.matches());运行结果为:
A.false true
B.true false
C.true true
D.false false
正确答案是A
Pattern p=Pattern.compile("\\d+"); Matcher m=p.matcher("22bb23"); System.out.println(m.matches()); Matcher m2=p.matcher("2223"); System.out.println(m2.matches());运行结果为:
A.false true
B.true false
C.true true
D.false false
正确答案是A