How to check if result is a mobile number?

shabbysquire

Client
Регистрация
25.11.2012
Сообщения
544
Благодарностей
26
Баллы
28
When scraping telephone numbers, I need to only collect mobile numbers that start with: 07.

Is it possible to check if a no begins with: 07? I suppose regex first two digits, then ensure that they match both 0 and 7.

Thanks.
 

Tobbe

Client
Регистрация
01.08.2013
Сообщения
428
Благодарностей
148
Баллы
43
Yes you can use regex for that. Without knowing more specific of what format you're looking for maybe this will get you going.

http://tobbe.co/regex
 
  • Спасибо
Реакции: shabbysquire

shabbysquire

Client
Регистрация
25.11.2012
Сообщения
544
Благодарностей
26
Баллы
28
Thanks Tobbe. Just ran it through text processing > regex, then check for any results via the IF statement.

Another issue. Because UK mobile numbers are 11 digits in total, I need to grab only 11. I use this:

07.{9}

But my regex also matches with mob nos that are longer, like this example. It would be great to ignore any mob nos that exceed 11 digits.
 

Tobbe

Client
Регистрация
01.08.2013
Сообщения
428
Благодарностей
148
Баллы
43

The match can not be followed by any character or number.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)