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
Phonelib appears to return almost all numbers I tested as German numbers. Out of the 67 numbers I tried, from 60 different countries only 3 returned correctly using the following code, the rest being returned as Germany.
Phonelib.parse(number).country
The text was updated successfully, but these errors were encountered:
@mgibson8 It's hard to determine whether number is valid or not in case of Germany. Valid number can be from 5 to 15 digits after the country code. Such regex is really awesome.
I can provide you with additional setting like prefer country detection prior to default country parsing, meaning phonelib will try to detect country by prefix, and in case it won't be able to parse as valid number will failover to default country.
Will it suite your needs?
@daddyz The strict_double_prefix_check option does not seem to do fix this issue. Or am I misunderstanding anything here? I would expect a number with a '+41' prefix to first be checked for the swiss country regex, and then for the default country.
When setting the default country like so..
Phonelib appears to return almost all numbers I tested as German numbers. Out of the 67 numbers I tried, from 60 different countries only 3 returned correctly using the following code, the rest being returned as Germany.
The text was updated successfully, but these errors were encountered: