hi folks -
I know very little about regex so this is bound to be simple...
I need to scan thru a db and check postcodes are in the format AB1 123, AB10
123 or A12 123.
Now I know I need to use regex but am struggling with the syntax...
I thought postcode REGEXP '([a-z][a-z][0-9][0-9] [0-9][a-z][a-z])' might do
it for the second
pattern(letter, letter,number,n umber,space,num ber,letter,lett er) but all this
seems to do is ignore the sequence and just says 'does this include numbers
and letters and spaces?' Yep? ok then its a pass even when the pattern is
not what I want.
help please!!
Jon
I know very little about regex so this is bound to be simple...
I need to scan thru a db and check postcodes are in the format AB1 123, AB10
123 or A12 123.
Now I know I need to use regex but am struggling with the syntax...
I thought postcode REGEXP '([a-z][a-z][0-9][0-9] [0-9][a-z][a-z])' might do
it for the second
pattern(letter, letter,number,n umber,space,num ber,letter,lett er) but all this
seems to do is ignore the sequence and just says 'does this include numbers
and letters and spaces?' Yep? ok then its a pass even when the pattern is
not what I want.
help please!!
Jon
Comment