title: Regular expression match all UK registration plates in PHP
body: <p>I'm trying to search a string for all valid UK registration plates. I found the following regular expression which matches both pre/post 2001 UK number plates:</p>
  
  <pre><code>^([A-Z]{3}\s?(\d{3}|\d{2}|d{1})\s?[A-Z])|([A-Z]\s?(\d{3}|\d{2}|\d{1})\s?[A-Z]{3})|(([A-HK-PRSVWY][A-HJ-PR-Y])\s?([0][2-9]|[1-9][0-9])\s?[A-HJ-PR-Z]{3})$
  </code></pre>
  
  <p>How would I go about using that with preg_match_all to return all valid number plates found in a string?</p>
  
  <p>For example:</p>
  
  <p><code>This is some random text NV07 ABC This is A0123 ABC some more random text AB08ABC</code></p>
  
  <p>Should return:</p>
  
  <ul>
  <li><p>NV07 ABC</p></li>
  <li><p>AB08ABC</p></li>
  </ul>