Searching for phone numbers in mysql

后端 未结 16 2512
耶瑟儿~
耶瑟儿~ 2020-12-30 06:40

I have a table which is full of arbitrarily formatted phone numbers, like this

027 123 5644
021 393-5593
(07) 123 456
042123456

I need to sea

16条回答
  •  甜味超标
    2020-12-30 06:52

    I know this is ancient history, but I found it while looking for a similar solution.

    A simple REGEXP may work:

    select * from phone_table where phone1 REGEXP "07[^0-9]*123[^0-9]*456"
    

    This would match the phonenumber column with or without any separating characters.

提交回复
热议问题