title: Regular Expression : At least one letter, At least one number, Certain length And Does not include
body: <p>I am using regular expressions with Groovy.</p>
  
  <p>I am trying to formulate a regular expression with the following rules.</p>
  
  <ol>
  <li>Must be exactly 17 characters </li>
  <li>Must only contain letters and numbers  </li>
  <li>Must contain at least 1 alpha and 1 numeric character </li>
  <li>Cannot contain the letters ‘I’, ‘O’ or ‘Q’ (Upper or Lowercase)</li>
  </ol>
  
  <p>With the expression below I think I am almost there. The regular expression below seems to take care of requirement 1,2 and 3. </p>
  
  <pre><code> def pttrnVin = /^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+){17}$/
  </code></pre>
  
  <p>I've tried to add in requirement 4 but am having no success. Could someone please help me with that?</p>
  
  <p>thanks</p>