title: Regular Expression pattern : alphanumeric(compulsory) , some special characters (optional)
body: <p>I have this:</p>
  
  <pre><code>&lt;input type="password" value="" pattern="^(?=.{8,}$)(([a-zA-Z0-9])\2?(?!\2))+$" required/&gt;
  </code></pre>
  
  <p>The non consecutive repeating characters work fine but I am having trouble making it strictly alphanumeric and allow some special characters( ! $ ( ) , - . : ; ? @ { } [ ] ^_ "). The special characters are not compulsory but okay if inputted by user.</p>
  
  <p>summary:</p>
  
  <p>1.Must be between 8 and 30 characters
     2.Must not contain 3 consecutive repeating characters
     3.Must have a minimum of 1 letter
     4.Must have a minimum of 1 number
     5.Only the following special characters are allowed: ! $ ( ) , - . : ; ? @ { } [ ] ^_ ~ `"</p>