1
正则表达式:((?=.*\d)(?=.*[A-Z]))
HTML模式简化版,即使有正确的正则表达式工作
输入字符串:qwer1Q
输入字符串以上通过验证,如果你在regex101
检查然而,如果您将html正则表达式包含在html pattern
属性中,并尝试再次验证相同的字符串,但不得通过:
<form>
<div>
<input type="text" placeholder="Password"
pattern="((?=.*\d)(?=.*[A-Z]))">
</div>
<div>
<button>Submit</button>
</div>
</form>