Skip to content

Instantly share code, notes, and snippets.

@damour
Last active December 13, 2015 18:58
Show Gist options
  • Save damour/4959422 to your computer and use it in GitHub Desktop.
Save damour/4959422 to your computer and use it in GitHub Desktop.
Регулярное выражение правильность украинских номеров (моб и городской 7-значный) PHP, javascript thanks http://habrahabr.ru/users/Kindman/
preg_match("/(?<!\w)(?:(?:(?:(?:\+?3)?8\W{0,5})?0\W{0,5})?[34569]\s?\d[^\w,;(\+]{0,5})?\d\W{0,5}\d\W{0,5}\d\W{0,5}\d\W{0,5}\d\W{0,5}\d\W{0,5}\d(?!(\W?\d))/x", $_POST['tel'], $output_array)
if (/(\w)(?:(?:(?:(?:\+?3)?8\W{0,5})?0\W{0,5})?[34569]\s?\d[^\w,;(\+]{0,5})?\d\W{0,5}\d\W{0,5}\d\W{0,5}\d\W{0,5}\d\W{0,5}\d\W{0,5}\d(?!(\W?\d))/.test($('#phone').val()) == false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment