title: Negative lookbehind on a capture group
body: <p>I'm trying to write some regex that will allow me to do a negative lookbehind on a capture group so that I can extract possible references from emails. I need to know how to look behind from a certain point to the first white space. If a digit is found, I don't want the reference to be extracted.</p>
  
  <p>I have got as far as shown below. I have 2 capture groups - 'PreRef' and 'Ref'. I don't want a 'Ref' match to be found if 'PreRef' contains a digit. What I've got so far only checks if the character immediately before the colon is a digit.</p>
  
  <pre><code>(?&lt;PreRef&gt;\S+)(?&lt;![\d]):(?&lt;Ref&gt;\d{5})
  </code></pre>
  
  <p>A 'Ref' match of 12345 should be found here: </p>
  
  <pre><code>This is a reference:12345
  </code></pre>
  
  <p>But not here (there's a 5 in the word 'reference'):</p>
  
  <pre><code>This is not a ref5rence:12345
  </code></pre>