Closed leonardovillela closed 4 years ago
First of all thanks for the maintainers of this awesome lib by the work done in it.
If this is really an issue I have the interest to work on a fix 😃
Hi.
findPhoneNumbersInText()
is not a "parse" function and it only finds "human-readable" phone numbers in "human-readable" text, not in some random string.
HI @catamphetamine, thanks for the answer.
If I remove the last "a" from the text(resulting in: ''a+12025550188") the findPhoneNumbersInText
function will find the phone number. My question is, using my example above is this a "human-readable" text?
@leonardovillela Whatever that is, this is most likely how Google implemented it.
It is not, because in google version of libphonenumber the scenario that I described in my first comment works, as you can see on this link. https://libphonenumber.appspot.com/phonenumberparser?number=a%2B12025550188a
It is not, because in google version of libphonenumber the scenario that I described in my first comment works, as you can see on this link.
There seems to be no evidence of that. Perhaps you'd show what exactly do you mean.
The link above is not the evidence? Since it uses google libphonenumber and it finds the phone number from the string 'a+12025550188a'
.
@leonardovillela Again, you're not being specific.
You're talking about findPhoneNumbersInText()
which is a port of Google's findNumbers()
.
If you provide the evidence that findNumbers()
behaves differently than findPhoneNumbersInText()
then this could be a bug report. Otherwise, it's just noise.
Steps to reproduce
Go to https://npm.runkit.com/libphonenumber-js and call
findPhoneNumbersInText
function on the string'a+12025550188a'
.Code snippet used:
Observed result
An empty array
[]
.Expected result
An array with a phone number extracted from the text.
Google's demo link
https://libphonenumber.appspot.com/phonenumberparser?number=a%2B12025550188a