title: PHP Validation: 1st Line of address and postcode
body: <p>I want to do some validation in PHP (of a postal address).</p>
  
  <p>For example, validate first line of address and postcode: </p>
  
  <pre><code>123 Some Road
  </code></pre>
  
  <p>and </p>
  
  <pre><code> W3 1TJ
  </code></pre>
  
  <p>These two fields both have a number, letter and a space.</p>
  
  <p>I've tried a couple of regular expression patterns but its not accepting the space and this is where I need help.</p>
  
  <p>Here's the code I used so far:</p>
  
  <pre><code>$address1CheckPattern = '/^[a-z0-9-]+$/';
  
  $adress1HasError = !preg_match($address1CheckPattern, $address1);
  </code></pre>