title: Regular Expression find space delimited numbers
body: <p>I have a string that comes from user input through a messaging system, this can contain a series of 4 digit numbers, but as users are likely to type things in wrong it needs to be a little bit flexible.
  Therefore I want to allow them to type in the numbers, or pepper their message with any string of characters and then just take the numbers that match the formats</p>
  
  <pre><code>=nnnn or nnnn
  </code></pre>
  
  <p>For this I have the Regular Expression:</p>
  
  <pre><code>(^|=|\s)\d{4}(\s|$)
  </code></pre>
  
  <p>Which almost works, however as it says that each group of 4 digits must start with an =, a space, or the start of the string it misses every other set of numbers</p>
  
  <p>I tried this:</p>
  
  <pre><code>(^|=|\s*)\d{4}(\s|$)
  </code></pre>
  
  <p>But that means that any four digits followed by a space get matched - which is incorrect.</p>
  
  <p>How can I match groups of numbers, but include a single space at the end of one group, and the beginning of the next, to clarify this string:</p>
  
  <pre><code>Ack 9876 3456 3467 4578 4567
  </code></pre>
  
  <p>Should produce the matches:</p>
  
  <pre><code>9876
  3456 
  3467 
  4578 
  4567
  </code></pre>