<form>
Password <input type="text" pattern="/^[a-zA-Z0-9!@#$%^&*_=+-]{8,12}$/g" />
<input type="submit" value="Submit" />
</form>
<input type="text"
pattern="^(?=.*?[A-Z])(?=(.*[a-z]){1,})(?=(.*[d]){1,})(?=(.*[W]){1,})(?!.*s).{8,}$" />
This regex will enforce these rules:
At least one upper case English letter
At least one lower case English letter
At least one digit
At least one special character
Minimum eight in length