catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.76k stars 218 forks source link

Find phone numbers in text doesn't work if fr and us are mixed #459

Open fstn opened 6 months ago

fstn commented 6 months ago

Got o the demo https://catamphetamine.gitlab.io/libphonenumber-js/?parseCountry=US&parseValue=213-373-4253&asYouTypeCountry=US&findNumbersCountry=US&findNumbersText=My%20phone%20number%20is%20%2B1%20123-456-7890%20and%20my%20other%20number%20is%20%2B33%201%2023%2045%2067%2089 and search number for:

My phone number is +1 123-456-7890 and my other number is +33 1 23 45 67 89

Result will be: Phone numbers found: 1 My phone number is +1 123-456-7890 and my other number is +33 1 23 45 67 89 Number: +33123456789, Country: FR, Starts at: 58, Ends at: 75

catamphetamine commented 6 months ago

Most likely “+1 123-456-7890” is not a valid one

On Fri, 1 Mar 2024 at 07:27, fstn @.***> wrote:

Got o the demo https://catamphetamine.gitlab.io/libphonenumber-js/?parseCountry=US&parseValue=213-373-4253&asYouTypeCountry=US&findNumbersCountry=US&findNumbersText=My%20phone%20number%20is%20%2B1%20123-456-7890%20and%20my%20other%20number%20is%20%2B33%201%2023%2045%2067%2089 and search number for:

My phone number is +1 123-456-7890 and my other number is +33 1 23 45 67 89

Result will be: Phone numbers found: 1 My phone number is +1 123-456-7890 and my other number is +33 1 23 45 67 89 Number: +33123456789, Country: FR, Starts at: 58, Ends at: 75

— Reply to this email directly, view it on GitHub https://github.com/catamphetamine/libphonenumber-js/issues/459, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADUP37O4HBAHUHA64LLYJLYV77RNAVCNFSM6AAAAABEBDM7LCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DENJYGAZTOMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>