Forum Moderators: open
<input type="password" id="password" name="password" required pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[@$!%*?&])[A-Za-z0-9@$_!%*?&-]{8,20}$" /> (?=.*[a-z])Can’t each of these bits simply be replaced by
(?=.*[a-z].*[a-z])
if the object is to find at least two of each? Or does your RegEx engine not accept that syntax?
<tangent>
Is it really safe to put this pattern right there in the visible html where any passing robot can see it?
</tangent>
Or does your RegEx engine not accept that syntax?
instead of captcha, I add invisible fields. That is in css I add a "div_name{display:none;} and then in the form you simply add the inputs using the name password, etc. for the input name and hide them under the invisible div. When it comes to the script, if that field isn't empty you can re-direct them to a spam site or something and stop processing of the form.