title: Check hasClass using regex in jquery
body: <p>I have few classnames like this: </p>
  
  <pre><code>&lt;div class=".error .error-code-123"&gt;
  </code></pre>
  
  <p>Now I want to to check whether the <em>.error</em> class has any <em>.error-code-SOME_NUMBER</em>.</p>
  
  <p>I tried something like this:</p>
  
  <pre><code>$(".error").hasClass(/.error-code-[0-9]/)
  </code></pre>
  
  <p>Just trying to use regex here, which does not work. How can I check the above scenario using jquery?</p>