-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Simos Xenitellis wrote on 19/06/15 18:52: > > On Fri, Jun 19, 2015 at 2:06 AM, Roman Shchekin > <mrqt...@gmail.com> >> >> It's quite easier to check if text contains only digits and (or) >> other symbols which are available in a phone number. But which >> symbols are available in phone number? +, whitespace, (, ), -, >> any suggestions? > > Add '#', '*' to the list. It is used in several countries to enable > services like disabling the sending of caller-id when making a > call, on a call-by-call basis > (https://en.wikipedia.org/wiki/Caller_ID#Disabling). For example, > you would type *31# and then the rest of the telephone number. > > ...
If you wanted a list of all the characters that anyone might use to separate digits in a phone number, you could start by searching the glibc locale data for "tel_dom_fmt" and "tel_int_fmt": bzr branch lp:glibc && grep "tel_dom_fmt\|tel_int_fmt" \ glibc/localedata/locales/* But that list is not guaranteed to be complete, because people in a single locale may use a variety of phone number formats, while the locale data includes only one of those formats per locale. And then there's the special characters we might introduce into phone numbers later for pausing or waiting for a reply. <http://launchpad.net/bugs/1308068> So that approach seems a bit error-prone. And I'm not sure what this code is doing, but it seems to be assuming that any search token that doesn't contain a letter must be part of a phone number, which isn't correct anyway. A number might be part of an address or a business name. - -- mpt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWG7FIACgkQ6PUxNfU6ecrnmwCfZvgD8oke0TR4GiwBrHpKU/YU bXAAni5zqQncCjy/+4i3tCsFZUBkLtUE =gaps -----END PGP SIGNATURE----- -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp