Pattern p = Pattern.compile("(\\d{3,5})([a-z]{2})");
String s = "122jj-212js-33442ad-00";
Matcher m = p.matcher(s);
while(m.find()){
p(m.group(1));
}
在Pattern中第一个左括号为第一组 所以group中写
group(1)
Pattern p = Pattern.compile("(\\d{3,5})([a-z]{2})");
String s = "122jj-212js-33442ad-00";
Matcher m = p.matcher(s);
while(m.find()){
p(m.group(1));
}
group(1)