题目内容
阅读程序题(给出【代码】注释标注的代码的输出结果)import java.util.regex. * ;public class E {public static void main( String args[ ]) {String s = ”10月1日至11月6日禁止通行”;String regex =" [ 0 - 9 ] + [月曰] ";Pattern p = Pattern.compile(regex);Matcher m = p.matcher(s);int count = 0;String item ="";while(m.find()) {item = m.group ();count ++;}System.out.printf(" % d: %s",count,item);//【代码】}}
查看答案
搜索结果不匹配?点我反馈