java正则表达式判断字符串是否仅含有数字和字母

java正则表达式判断字符串是否仅含有数字和字母

直接上代码

public static boolean isLetterDigit(String str) {
  String regex = "^[a-z0-9A-Z]+$";
  return str.matches(regex);
 }

猜你喜欢

转载自blog.csdn.net/weixin_42260102/article/details/84639834