Discuss / Python / 交作业

交作业

Topic source

HellPlay

#1 Created at ... [Delete] [Delete and Lock User]

第一题

def is_valid_email(addr):

    return re.match(r'[0-9a-zA-Z\_\.]+@[0-9a-zA-Z\_]+\.com',addr)

第二题

def name_of_email(addr):

    return [x for x in re.split(r'[\<\>\@]+', addr) if x][0]


  • 1

Reply