java正则表达式判断字符串是否仅含有数字和字母
直接上代码
public static boolean isLetterDigit(String str) {
String regex = "^[a-z0-9A-Z]+$";
return str.matches(regex);
}
微信扫一扫
public static boolean isLetterDigit(String str) {
String regex = "^[a-z0-9A-Z]+$";
return str.matches(regex);
}
相关推荐