HTML5输入模式匹配不起作用,Rubular正则表达式

时间:2017-11-02 20:41:10

标签: ruby regex html5

关于为什么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会吗?

1 个答案:

答案 0 :(得分:2)

您必须将输入\A的开头替换为^,将输入的结尾替换为\z

&#13;
&#13;
$
&#13;
&#13;
&#13;