### Question:
PatternMatcherDemo { public void execute(){ Pattern p = Pattern.compile("\\w+"); System.out.println(p.pattern()); p = Pattern.compile("\\d+"); String[] str=p.split("我的QQ是:1232423 我的电话是:1234288dsfa我的邮箱是:abc@126.com"); System.out.println(Arrays.toString(str)); boolean rtnBoolean = Pattern.matches("\\d+","1231423"); System.out.println(rtnBoolean); rtnBoolean = Pattern.matches("\\d+","3143bac"); System.out.println(rtnBoolean); rtnBoolean = Pattern.matches("\\d+","sdafds2323"); System.out.println(rtnBoolean); p = Pattern.compile("\\d+"); Matcher m=p.matcher("123213asgas"); rtnBoolean = m.matches(); System.out.println(rtnBoolean); Matcher m2=p.matcher("1223"); rtnBoolean = m2.matches(); System.out.println(rtnBoolean); p=Pattern.compile("\\d+"); m=p.matcher("22aa23"); rtnBoolean = m.lookingAt(); System.out.println(rtnBoolean); m2=p.matcher("bb1233"); rtnBoolean = m2.lookingAt(); System.out.println(rtnBoolean); p=Pattern.compile("\\d+"); m=p.matcher("22bb23"); rtnBoolean = m.find(); System.out.println(rtnBoolean); m2=p.matcher("aa2223aa"); rtnBoolean = m2.find(); System.out.println(rtnBoolean); Matcher m3=p.matcher("aa2223bbcc"); rtnBoolean = m3.find(); System.out.println(rtnBoolean); Matcher m4=p.matcher("ccaa"); rtnBoolean = m4.find(); System.out.println(rtnBoolean); matherMethodsFind("\\d+","aaa2223bb"); matherMethodsLookingAt("\\d+","2223bb"); matherMethodsMatches("\\d+","123456"); p=Pattern.compile("([a-z]+)(\\d+)"); m=p.matcher("aaa2223bb"); int groupCount = m.groupCount(); System.out.println("总分组数目：" + groupCount); while(m.find()){ int start = m.start(); int end = m.end(); String groupStr = m.group(); System.out.println("start = [" + start +"] end = [" +end+"] group=["+groupStr+"]" ); } }  void execute();  }### Answer:
@Test public void test(){ PatternMatcherDemo patternMatcherDemo = new PatternMatcherDemo(); patternMatcherDemo.execute(); }