1.表达式:
^[1-9]d*$
2.需要校验的内容
78
代码校验
Pattern r = Pattern.compile(expression); Matcher m = r.matcher(content); Boolean a =m.matches();
匹配上了为ture 不匹配为false
这个正则表达式也支持匹配中文 只要你把表达式需要匹配的内容设置成为中文就可以

1.表达式:
^[1-9]d*$
2.需要校验的内容
78
代码校验
Pattern r = Pattern.compile(expression); Matcher m = r.matcher(content); Boolean a =m.matches();
匹配上了为ture 不匹配为false
这个正则表达式也支持匹配中文 只要你把表达式需要匹配的内容设置成为中文就可以