关于为什么https://codepen.io/anon/pen/qVbjGa:
的任何想法<form>
<input type="text" name="formField" title="Password must be at least eight characters in length, contain at least one capital letter, one number, and one special character."
pattern="\A(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_])(?=.*[\d]).{8,}\z" required />
<input type="submit" value="Submit" />
</form>
不会工作而http://rubular.com/r/9oIgojECMf会吗?
答案 0 :(得分:2)
您必须将输入\A
的开头替换为^
,将输入的结尾替换为\z
$
&#13;