<form> Password <input type="text" pattern="/^[a-zA-Z0-9!@#$%^&*_=+-]{8,12}$/g" /> <input type="submit" value="Submit" /> </form>