如何将这两者结合起来,以便我的字符串只匹配至少一个大字母和至少一个数字
return Regex.IsMatch(string,
@"\A(?=\P{Lu}*\p{Lu})(?=\P{Ll}*\p{Ll})\p{L}+\z");
//but this works only with Big and small Letter, i dont know how I include the numbers
"^[0-9]+$" //Numbers
@"\A(?=\P{Lu}*\p{Lu})(?=\P{Ll}*\p{Ll})\p{L}+\z")
//Letters which must receive at least one large
答案 0 :(得分:0)
略微改编自另一个答案:(?=.*[0-9])(?=.*[A-Z])([A-Z0-9]+)