title: Regular expression to match last number in a string
body: <p>I need to extract the last number that is inside a string. I'm trying to do this with regex and negative lookaheads, but it's not working. This is the regex that I have: </p>
  
  <pre><code>\d+(?!\d+)
  </code></pre>
  
  <p>And these are some strings, just to give you an idea, and what the regex should match:</p>
  
  <pre><code>ARRAY[123]         matches 123 
  ARRAY[123].ITEM[4] matches 4
  B:1000             matches 1000
  B:1000.10          matches 10
  </code></pre>
  
  <p>And so on. The regex matches the numbers, but all of them. I don't get why the negative lookahead is not working. Any one care to explain?</p>