如何有效地保留/更新每个国家的邮政和电话代码格式?
目前,我们有一个国家/地区电话和邮政编码的正则表达式格式表,用于在用户通过我们的表单注册时进行验证。
但问题仍然在于维护这些格式的正确性,那么有什么好方法可以确保我们始终拥有这些信息的最新副本呢?有没有一个网络服务/等等我可以用来得到这个?
或者保留所有这些格式是否有意义,而是使用宽松的方法来确保用户只需键入与格式大致匹配的内容?
该信息仅用于送货和帐单地址。 顺便说一句,我们正在使用 asp.net 2.0。
谢谢
currently we have a table for regex format for phone and postal code for countries that we use to validate when the user register through our forms.
but the problem remains on the maintenance on the correctness of these format, thus what's a good way to ensure that we always have the latest copy of this information? is there a web service/etc that i can use to get this?
or does it even make sense to keep all these format but instead use a relaxed method to ensure that the user just keys in something which roughly matches the format?
the information is used solely for shipping and billing address.
we're using asp.net 2.0 btw.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
万国邮联拥有有关国际邮政地址格式的信息,其中包括邮政编码,因此您可以定期检查那里。
The UPU hold information on international postal address formats, which includes postcodes, so you can periodically check there.
我不知道如何自动更新,这些东西时不时地会发生变化,而且你还需要向后支持,不足以了解当前的格式,所以通常我不会在手机上放置任何强大的东西格式。邮政编码更加稳定。
I don't know a way you can be updated automatically, these things get change every now and then, and you need to have backward support also, not enough to know the current format, so usually I don't put anything strong on phone format. postal codes are more stable.