You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PhoneNumberMatcher has an additional leniency argument that defaults to only accepting valid numbers (and the example is not valid).
Python 3.7.6 (default, Jan 8 2020, 13:42:34)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import phonenumbers as p
>>> x = p.parse('+17553927664', 'US')
>>> p.is_valid_number(x)
False
>>> for m in p.PhoneNumberMatcher('asdf 17553927664 ddd', 'US'):
... print(m)
...
>>> for m in p.PhoneNumberMatcher('asdf 17553927664 ddd', 'US', leniency=p.Leniency.POSSIBLE):
... print(m)
...
PhoneNumberMatch [5,16) 17553927664
Python version 3.8.10
phonenumbers version 8.13.3
In the Python3 interpreter with
parse
(as expected):Using
PhoneNumberMatcher
:Nothing is printed because there are no matches. With a different phone number, either method correctly parses the input:
I entered the 755 number in the Java form, as prescribed, and it seems to work.
The text was updated successfully, but these errors were encountered: