如何在Perl中比较国际电话号码? [英] How can I compare international phone numbers in Perl?
问题描述
有没有可以帮助我比较电话号码是否相等的模块?
Are there any modules that can help me compare phone numbers for equality?
例如,以下三个数字是等效的(从英国拨打时)
For example, the following three numbers are equivalent (when dialling from the UK)
+44 (0)181 1234123
00441811234123
0181 1234123
是否有一个perl模块可以告诉我这一点?
Is there a perl module that can tell me this?
推荐答案
我能在 CPAN 上看到的最接近的 >是 Number :: Phone 其中是一个活跃的项目,并且支持UK电话号码.它应该适用于您给出的特定示例.支持一些国家.
The closest I can see on CPAN is Number::Phone which is an active project, and supports UK Phone numbers. It should work for the specific example you give. A few countries are supported.
如果您拥有其他国家/地区的电话号码,则由于本地格式特殊性,事情可能会变得更加困难.
If you've got phone numbers for other countries things could get more difficult due to local formatting idiosyncrasies.
这篇关于如何在Perl中比较国际电话号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!