title: Regular Expression to validate UK National Insurance Number
body: <p>I have the following regular expression which validates the British National Insurance Number </p>
  
  <pre><code>^([a-zA-Z]){2}( )?([0-9]){2}( )?([0-9]){2}( )?([0-9]){2}( )?([a-zA-Z]){1}?$
  </code></pre>
  
  <p>Accepted values are:</p>
  
  <pre><code>AB 12 34 56 A
  
  AB123456A
  </code></pre>
  
  <p>I want this values also to be accepted. can anyone please help me sort out this?</p>
  
  <pre><code>AB 123456 A
  
  AB 123 456 A
  
  AB 1 2345 6 A
  
      AB   12   34   56 A    (multiple space anywhere)
  </code></pre>
  
  <p>The RE should work even if there are extra or no spaces in the string. Is this possible to do in RE? Thank you in advance.</p>