Phone numbers

Report a typo

Besides our love for email adress matching, another funny (i.e. most common) application of regular expressions is phone number extraction. Your task is to write a program that will take a string as an input and match the phone numbers. The output should be of the following format:

Full number: +1-234-567-89-00
Country code: 1
Area code: 234
Number: 567-89-00

If no matches are found, the program should print No match.

Note that instead of a dash -separating the numbers there might be a whitespace or no separators at all. The phone numbers always start with +.

Sample Input 1:

+1-234-567-89-00

Sample Output 1:

Full number: +1-234-567-89-00
Country code: 1
Area code: 234
Number: 567-89-00
Write a program in Python 3
import re

string = input()
# your code here
___

Create a free account to access the full topic