题解 | 电话号码格式校验

电话号码格式校验

https://www.nowcoder.com/practice/2c2453e909c04c29a04c11e9d6b2c769

select
    *
from
    contacts
where
    (char_length(phone_number) = 10 
    or phone_number like '___-___-____')
    and replace(phone_number,'-','') regexp '^[0-9]{10}$'
    and left(phone_number, 1) <> '0'
order by
    id;

全部评论

相关推荐

xtu大迫杰:偶遇校友,祝校友offer打牌
点赞 评论 收藏
分享
04-01 16:02
已编辑
武汉工程大学 Java
牛客98843461...:处女面??我还种马面渣男面处男面呢
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务