title: How to get the first characters before a blank space in a post code in python?
body: <p>I have a column in a pandas dataframe with post codes sometimes they have 4 digits before the blank space sometimes 3 i.e.</p>
  
  <pre><code> NE5 2NY
   NE49 9PB
  </code></pre>
  
  <p>What would be the regex to use to replace these strings with only the characters before the blank space?</p>