title: how to determine which class of element have a number inside it
body: <p>I want to find which class have a number inside it and get it via jquery.
  I know there could be used data attribute, but I need to implement className+number solution.  </p>
  
  <p>I guess it could be simple, but can not find an answer.</p>
  
  <p>I tried to use regex like:</p>
  
  <p>1) <code>$(this).attr('class').match(/\d+/)[0];</code> and </p>
  
  <p>2) <code>$(this).attr('class').match(/number-\d+)/)[0];</code></p>
  
  <p>Both regex works but they get only value of #works, not of #doesnot. 
  I guess it is because second div has 2 classes (in my case I will have lots of elements with several classes with similar beginning).</p>
  
  <p>My code (just for referral):</p>
  
  <pre><code>&lt;div&gt;
     &lt;div id="works" class="number-1"&gt;&lt;/div&gt;
     &lt;div id="doesnot" class="second number-2"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Please advice, how could I select only a class with number (from several classes) and get that number?  </p>