如何限制密码,使其不允许第一个或最后一个字符为非字母字符(参见“标题”)?
我的 HTML 代码:
<form action = "." method="post">
<input type="password"
placeholder = "New Password..."
name= "password"
title = "Password must be at least 8 characters, at least one alphabetic character [a-zA-Z], at least one non-alphabetic character, which is not the first or last character."
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}">
</form>
*hi123HI
示例:密码 hi123*HI 被接受,但由于第一个字符是第一个字符,我如何拒绝*
(如果*
是最后一个字符,或者特殊字符或数字既是第一个字符又是最后一个字符)。