sql server - SQL mobile number validation -
i have sql database filter out valid mobile numbers.
i use follows;
where pn.phonenumber '+[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' or pn.phonenumber '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' or pn.phonenumber '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' or pn.phonenumber '[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]'
however still receive numbers such 0000000
, 0
,0000
etc.
of numbers aren't irish mobiles either don't begin 08
.
fix there if wanted beginning of number begin 087
input [0][8][7]
instead of [0-9]
?
try testing !
this'll give numbers starting 087
, mobile(length)=10
select * table mobile_number '087%' , len(mobile_number)=10
Comments
Post a Comment