????find() + start() + end()
????find() ??????????????в????????????????????????Matcher?????? Pattern.matcher(text) ???????????????????ж?????find() ???????????????????ε??? find() ?????????????
????start() ?? end() ????????????????????????е????????λ?á??????? end() ?????????????β????λ??????????????? start() ?? end() ?????????????String.substring() ??
????String text    =
????"This is the text which is to be searched " +
????"for occurrences of the word 'is'.";
????String patternString = "is";
????Pattern pattern = Pattern.compile(patternString);
????Matcher matcher = pattern.matcher(text);
????int count = 0;
????while(matcher.find()) {
????count++;
????System.out.println("found: " + count + " : "  + matcher.start() + " - " + matcher.end());
????}
??????????????????????? “is” 4?Σ????????:
????found: 1 : 2 - 4
????found: 2 : 5 - 7
????found: 3 : 23 - 25
????found: 4 : 70 - 72
????reset()
????reset() ??????????Matcher??????????????find() ?????????????Matcher ?????????????????????????? reset() ?????′????????????
???????????? reset(CharSequence) ????. ???????????Matcher??????????μ???????????????????????洴?? Matcher ???????????
????group()
???????????????????в???URL???????????????????????????????????????? start()?? end()??????ɡ???????group()??????????Щ??
?????????????????????????????????:
????(John)
????????????????John?? ??????????????????????????????????顣??????????????????????????????????
???????group(int groupNo) ??????????????顣???????????????ж?????顣?????????????????????????????????????????????????????????????? group(int groupNo)??????
????group(0) ??????????????????????????????????飬??????????1???????
????String text    =  "John writes about this?? and John writes about that??" +
????" and John writes about everything. "  ;
????String patternString1 = "(John)";
????Pattern pattern = Pattern.compile(patternString1);
????Matcher matcher = pattern.matcher(text);
????while(matcher.find()) {
????System.out.println("found: " + matcher.group(1));
????}
??????????????????????????John.????????????У????????1????????????????????????
????found: John
????found: John
????found: John