RT 6到20位数字和字母组合 正则表达式,也就是既要有数字也要有字母 不区分大小写
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/21 17:10:47
RT 6到20位数字和字母组合 正则表达式,也就是既要有数字也要有字母 不区分大小写
不多说直接上代码
java版
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ZhengZe {
public static void main(String z[]) {
Pattern pat = Pattern.compile("[\\da-zA-Z]{6,20}");
Pattern patno = Pattern.compile(".*\\d.*");
Pattern paten = Pattern.compile(".*[a-zA-Z].*");
String str = "111111111111111111aa";
Matcher mat = pat.matcher(str);
Matcher matno = patno.matcher(str);
Matcher maten = paten.matcher(str);
if(matno.matches()&& maten.matches() && mat.matches()){
System.out.println(str);
}
}
}
java版
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ZhengZe {
public static void main(String z[]) {
Pattern pat = Pattern.compile("[\\da-zA-Z]{6,20}");
Pattern patno = Pattern.compile(".*\\d.*");
Pattern paten = Pattern.compile(".*[a-zA-Z].*");
String str = "111111111111111111aa";
Matcher mat = pat.matcher(str);
Matcher matno = patno.matcher(str);
Matcher maten = paten.matcher(str);
if(matno.matches()&& maten.matches() && mat.matches()){
System.out.println(str);
}
}
}
RT 6到20位数字和字母组合 正则表达式,也就是既要有数字也要有字母 不区分大小写
正则表达式:要求6-20位,只能有大小写字母和数字,并且大小写字母和数字都要有.
密码由6一16位字符(字母/数字/符号)不能只有一种,区分大小写正则表达式!
6-20个字符,以字母数字组合,不区分大小写.
如何用正则表达式表示由数字和字母构成,长度为6到15位的密码
求由数字,英语字母,符号随意组成的6-20位的密码正则表达式,
4位以上 到8位的密码 包括数字 符号 大小写字母 一工有多少组合
正则表达式 大于等于10位且必须由字母,数字和特殊符号组成怎么写?
正则表达式 数字和字母至少出现一次 18位 如何写
求一密码正则表达式 要求:10位以上 数字+字母+特殊符号组合 需要C#的和JS里面的两种写法
求一验证姓名的正则表达式,姓名可以是数字字母跟汉字,以及数字字母汉字的各种组合,但是不能超过10位,
6-16位字母或数字的正则表达式怎么写?