1.Java的正则表达式
参考文章:https://www.cnblogs.com/hubingxu/archive/2012/02/17/2355516.html
matcher.find()方法是部分匹配,是查找输入串中与模式匹配的子串,如果该匹配的串有组还可以使用group()函数。
matches()是全部匹配,是将整个输入串与模式匹配,如果要验证一个输入的数据是否为数字类型或其他类型,一般要用matches()。
String patternString = "abc";
String input = "abcabc";
Pattern pattern = Pattern.compile(patternString);
Matcher matcher = pattern.matcher(input);
if (matcher.matches()) {
System.out.println("Match");
int g = matcher.groupCount();
}