Code: Select all
$pat = '#^(?:(?P<1>ї(])?(?P<AreaCode>ї2-9]\d{2})(?(1)ї)]ї ]?|ї- \/.]?))?(?P<Prefix>ї1-9]\d{2})ї- .]?(?P<Suffix>\d{4})(?:(?:ї ]+|\s*?x\s*?|\s*?ext\s*?\.?ї ]?){1,2}(?P<Ext>\d{1,5}))?$#i';Code: Select all
$val = "e;905-945-0971x1234"e;;Code: Select all
Array
(
ї0] => 905-945-0971x1234
ї1] =>
ї2] =>
їAreaCode] => 905
ї3] => 905
їPrefix] => 945
ї4] => 945
їSuffix] => 0971
ї5] => 0971
їExt] => 1234
ї6] => 1234
)<edit> phone validation not email