in reply to phone number parsing refuses to work

The link disappeared, the module I want to try to use is Number/Phone/US.pm but there's no documentation for what I need to do. I need to parse an entire junk file and take all valid numbers OUT of it.
  • Comment on Re: phone number parsing refuses to work

Replies are listed 'Best First'.
Re: Re: phone number parsing refuses to work
by Happy-the-monk (Canon) on Mar 13, 2004 at 23:29 UTC
    use strict; use Number::Phone::US qw(is_valid_number); my $data = <<'EOF'; all your data goes here EOF my @results = ( $data =~ m/ ( # start caption \( # open paranthesis \d{3} # 3 digits \) # close paranthesis \s? # 0 or 1 whitespace \d{3} # 3 digits \- # 1 dash line \d{4} # 4 digits ) # end caption /xg ); foreach ( @results ) { print "valid: $_\n" if is_valid_number( $_ ); }

    Sören