memo.xight.org

日々のメモ

Number::Phone::JP - 日本の電話番号のValidator

Synopsis

use Number::Phone::JP;

my $tel = Number::Phone::JP->new('012', '34567890');
print "This is valid!!\n" if $tel->is_valid_number;

$tel->set_number('098 7654 3210');
print "This is valid!!\n" if $tel->is_valid_number;

$tel->import(qw(mobile PHS));
$tel->set_number('090-0123-4567');
print "This is valid!!\n" if $tel->is_valid_number;


Reference

Number::Phone::JP

via

にぽたん研究所 - 2005-03-29 - 本邦初公開!電話番号の正規表現
http://blog.livedoor.jp/nipotan/archives/17526053.html