Discuss / Python / 第二题与第一题一起

第二题与第一题一起

Topic source

Nicktimebreak

#1 Created at ... [Delete] [Delete and Lock User]
import re
def check_email(s):
    m = re.match(r'(\<\w+\s\w+\>\s)?(\w+(\.\w+)?\@\w+\.\w+)', s)
    if m:
        print('Email address checked')
        print('Name is', m.group(1))
    else:
        print('Email adress is not valid')

address = input('Please input your email address\n')
check_email(address)

  • 1

Reply