title: Regular expression for finding tag numbers in a list of cats
body: <p>I am trying to match the tag numbers in a list of cats:</p>
  
  <pre><code>Abyssinian 987
  Burmese a1a
  Dragon Li 2B
  987 Cat
  cat 987 Toyger
  cat A1A Siamese
  1
  </code></pre>
  
  <p>The tag numbers for the list of cats would be:</p>
  
  <pre><code>987
  a1a
  2B
  987
  987
  A1A
  1
  </code></pre>
  
  <p>I've tried using the regular expression:</p>
  
  <pre><code>\b[0-9a-zA-Z]{1,3}\b
  </code></pre>
  
  <p>The problem is that it will match "cat" and "Li" (in Dragon Li). It should only match the tag number.</p>
  
  <p>The requirements for a tag number are:</p>
  
  <ul>
  <li>1-3 characters, it must contain at least one integer (0-9)</li>
  <li>It can appear at any place in the string</li>
  </ul>
  
  <p>As a side note, I am using Postgres regular expressions, which I think use POSIX regular expressions. (<a href="http://www.postgresql.org/docs/9.3/static/functions-string.html" rel="nofollow">http://www.postgresql.org/docs/9.3/static/functions-string.html</a>)</p>