mssql sqlserver sql脚本匹配电话号码的方法分享


摘要:
下文分享sql脚本中匹配手机号码的正则表达式,如下所示:
实验环境:sql server 2008 R2


  create table test
(tel varchar(50))

insert into test (tel)
values
('13824568000'),
('33824062031'),
('13824002031'),
('1382456000031')

--正确的手机号码
SELECT * FROM test WHERE LEN([tel])=11 
and [tel]  LIKE '[1][356789]%' 
and  [tel] not  LIKE '%[^0-9]%'
 
 

drop table test