Skip to content

Parse() not throwing error when expected #114

@david-dietz

Description

@david-dietz

When parsing out a String using libphonenumber.Parse() or libphonenumber.ParseAndKeepRawInput(), there are certain values that I would expect NumberParseException to be thrown, but instead the input is parsed "successfully" into a *PhoneNumber.
Here are some examples:

Example 1

 number, err := libphonenumber.Parse("123@gmail.com", "US")

Results in:

number.CountryCode = 1
number.NationalNumber = 2346245266

Example 2

 number, err := libphonenumber.Parse("email.133@gmail.com", "US")

Results in:

number.CountryCode = 1
number.NationalNumber = 3346245266

Example 3

number, err := libphonenumber.Parse("HEB17143428716", "US)

Results in

number.CountryCode = 1
number.NationalNumber = 7143428716

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions