You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if len(phone_number) < 9: raise IllegalPhoneNumberException('Phone number too short')
I believe the utility function for formatting phone numbers should be implemented using a regular expression, unless there was a specific reason not to do so
The text was updated successfully, but these errors were encountered:
Using regular expressions can be computationally more expensive (big O-notation) than simple string manipulation methods like checking the length and for non-alphanumeric characters.
When you're dealing with a specific and relatively simple phone number format, such as those commonly used in a particular region, using regular expressions might be unnecessary overhead. In such cases, directly checking the length and presence of non-alphanumeric characters can be more efficient.
if len(phone_number) < 9: raise IllegalPhoneNumberException('Phone number too short')
I believe the utility function for formatting phone numbers should be implemented using a regular expression, unless there was a specific reason not to do so
The text was updated successfully, but these errors were encountered: