Closed kamalbennani closed 3 years ago
It is expected for this library to not parse phone numbers not starting with a +
when no default country is provided.
The reason is that 0033781161949
number is still a French one, written in French notation.
In US that would be something like 011 33781161949
.
Thank you for your quick response.
I do agree with you, but what I don't understand, is why when we provide the 'BE' or even 'MA' countryCode as the default country, the number is still detected as a French number, but when providing another country such as 'US' or 'UK' the function returns an empty array. shouldn't return an empty array in both cases?
I do agree with you, but what I don't understand, is why when we provide the 'BE' or even 'MA' countryCode as the default country, the number is still detected as a French number, but when providing another country such as 'US' or 'UK' the function returns an empty array. shouldn't return an empty array in both cases?
I assume that BE
or MA
also use the 00
prefix for international numbers while US
and UK
don't.
You can check that in PhoneNumberMetadata.xml
.
First of all, I wanted to thank you so much for the amazing work you've accomplished and the time you are dedicating to maintain this library.
Steps to reproduce
We heavily use this library to find phone numbers in a given string/text and use
findPhoneNumbersInText
for that.But we found a "strange" behavior, where if you run the following code:
But the issue is that when you don't provide a country, like this:
Is it expected that we have this difference between putting an unrelated country to the number that this number is getting detected and not putting anything?
And the other stuff is that when you replace the "00" with a "+" it gets detected as an international French number without specifying the country code
And the other stuff also is that if you change 'BE' country with "US", it will return an empty array 🤷♂️
any help would be greatly appreciated