Discuss / Python / 打卡

打卡

Topic source

#1

def is_valid_email(addr):

    remail = re.compile(r'^[\w\.]+@\w+.com$')

    if remail.match(addr):

        return True

#2

def name_of_email(addr):

    rname = re.compile(r'.*?([\w\s]+)')

    return rname.match(addr).group(1)


  • 1

Reply