views:

27

answers:

1

I need a validation function for both UK and NI vehicle registration number. It can be two separate functions too.

+1  A: 

Have a look here.

The Chairman
I am trying to use this http://www.regexlib.com/RETester.aspx?regexp_id=617Like static public function isValidUKVehicleRegistration ($registration) { $regex = "/^([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})$/"; $valid = preg_match($regex, $registration); die(var_dump($valid)); return $valid; }but still failing to match a valid reg number.
boosis
Well that's out of date. 'T' wasn't assigned in 2001, but has been since (for Scotland).
Colin Fine