regex validation help needed
Posted: Thu Nov 09, 2006 7:49 am
Hi,
I have to validate canadian zip code which are in this format
L1T3H9 always 6 characters
total five characters ,
alpha numner alpha number alpha number
I am doing like the folowing, but it is not working, what di i need to do so that unless I have exact same format it fails
'regex' => '/^[A-Za-z][0-9][A-Za-z][0-9][A-Za-z][0-9]{6,6}$/'
thanks
I have to validate canadian zip code which are in this format
L1T3H9 always 6 characters
total five characters ,
alpha numner alpha number alpha number
I am doing like the folowing, but it is not working, what di i need to do so that unless I have exact same format it fails
'regex' => '/^[A-Za-z][0-9][A-Za-z][0-9][A-Za-z][0-9]{6,6}$/'
thanks