title: Regular Expressions for 16 digits and forward slash?
body: <p>ok so I am currently trying to use a regular expression to validate that my string has 16 numbers. Also a MM/YYYY format. They aren't working. </p>
  
  <pre><code>var cc = ccnum.value;
  cc = cc.replace(/\s/g, '');
  cc = cc.replace(/-/g, '');
  //Validate the credit card number:
  if (/^\d{16}$/.test(cc.value)) {
      removeErrorMessage('ccnum');
  } else {
      addErrorMessage('ccnum', 'Please enter a valid credit card number.');
      error = true;
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>if (/^\d{2}?\d{4}$/.test(exp.value) &amp;&amp; (expDate[0] &gt;= month) &amp;&amp; (expDate[1] &gt;= year)) {
  </code></pre>