-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phone numbers with two digit area code not recognized #10
Comments
At the top here are some nice regexs, incl. this one for phone numbers: r"""
(?:
(?: # (international)
\+?[01]
[ *\-.\)]*
)?
(?: # (area code)
[\(]?
\d{3}
[ *\-.\)]*
)?
\d{3} # exchange
[ *\-.\)]*
\d{4} # base
)""" maybe this fixes it? |
ok, I think this might work: |
phone_numbers = [
"2404 9099130",
"024049099130",
"02404 9099130",
"02404/9099130",
"+492404 9099130",
"+4924049099130",
"+492404/9099130",
"0160 123456789",
"0160/123456789",
"+32160 123456789",
"Tel.: 0160 123456789"
]
for i, number in enumerate(phone_numbers):
print(f"{i}: {text_cleaner.transform(number)}")
:( |
Thanks @cod3licious for providing the regex and thanks @AssassinTee for the test cases. I adapted the regex to make it work with all the provided phone numbers. |
The regex doesn't work with phone numbers like
|
this:
+1 123 1548690
is correctly identified as a phone number, but not this:+49 123 1548690
The text was updated successfully, but these errors were encountered: