Wednesday, April 21, 2010
parsing...
Awhile ago I wrote a contact import which basically imports a .csv of customer contact information in which a customer can easily import all their contacts to the application. The problem is that we accept all US telephone numbers with up to a 5 digit extension. On the back end we parse out everything that is not a number. So the number ranges from 7-15 digits when it is finally stripped down to what we need. Now the problem with doing it this way is that some cases become indistinguishable. Since we allow phone numbers without area codes we could potentially run in cases like 123-1234 ext.555 and 123-123-4555 when stripped down there is no way to tell which has an area code and which has an extension because they become:1231234555 and 1231234555 on the back-end. The potential fix for this would be requiring and x in front of extension numbers so it will be easier to parse out. The problem with this is that it requires more work on their end which kinda defeats the purpose of what we are doing in the first place. Right now it is not that big of a problem because we haven't encountered this case, but in the future we will need to handle this properly.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment