Split the Phone Numbers

  • + 0 comments

    perl

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    while(<>){
       if(/(\d{1,3}?)[-\s](\d{1,3}?)[-\s](\d+)/){
        print "CountryCode=$1,LocalAreaCode=$2,Number=$3\n";
       }
    	}