java 判断一个字符串中是否包含数字
String s="foewaifjelwj45rewqr";
String regex="[0-9]+?";
Pattern pattern=Pattern.compile(regex);
Matcher matcher=pattern.matcher(s);
boolean matches=matcher.matches();
如果 matches 为 true 则包含数字,
为 false 则不包含数字
java 判断一个字符串中是否包含数字
String s="foewaifjelwj45rewqr";
String regex="[0-9]+?";
Pattern pattern=Pattern.compile(regex);
Matcher matcher=pattern.matcher(s);
boolean matches=matcher.matches();
如果 matches 为 true 则包含数字,
为 false 则不包含数字