>From Ronald J Kimball on 28/11/06 3:47 pm:

> On Wed, Nov 29, 2006 at 02:21:41AM +1100, Randy Silvers wrote:
>>> First, the grep not only will match "N15" which is invalid, and not
>>> match "N15 4RC" which is valid, but it will not match "N15 4RCCCC"
>>> which is invalid.
> 
> Oops, I forgot to account for prefixes.  That's easy to fix, by adding a $
> inside the (?!).
> 
> ^(?![A-Z]{1,2}[\d]+ \d[A-Z][A-Z]$).+$
> 
> Now it correctly matches "N15 4RCCCC".  Thanks for catching that!
> 

> This regex is supposed to match all invalid post codes.  It was an
> oversight that it didn't match ones that are valid post codes plus extra
> characters.  :)
> 
> 
> HTH,
> Ronald

Thanks both for the eagle eyes - turns out I did have a few postcodes with
extra characters on the end, now dealt with.

Cheers
Rich


-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to