telefon numaralarını ayıklanması

0 Cevap php

Ben bir veri kümesinden telefon numaralarını exract çalışıyorum. Her ülkenin uluslararası ve yerel numaraları ayıklamak mümkün olmalıdır.

The rules I've laid out for it are: 1. Look for the international symbol, indicating it's an international dialing number with a valid extension(from +1 to +999). 2. If the plus symbol is present, make sure the next following character is a number. 3. If there is none, look at the length to validate it is between 7 and 10 digits long. 4. In the event that the number is divided (correctly via international standers) by either a hyphen(-) or space make sure the amount of digits in between them are either 3 or 4

Ne var bu kadar var olduğunu:

\+(?=[1-999])(\d{4}[0-9][-\s]\d{3}[0-9][-\s]\d{4}[0-9])|(\d{7,11}[0-9])

Uluslararası için, ve yerel arama \d{7,10} olduğunu

The thing is, that it doesn't actually pick up numbers with spaces or hyphens in it. Can anybody give me some advice on it?

0 Cevap