Discuss / Python / 作业

作业

Topic source

import re re_email = re.compile(r'([0-9a-zA-Z]@[0-9a-zA-Z].[a-zA-Z]*)')

print(re_email.match('someone@gmail.com').group(1))

re_email_v2 = re.compile(r'<([a-zA-Z\s])>[\s][0-9a-zA-Z]@[0-9a-zA-Z].[a-zA-Z]*') print(re_email_v2.match('<Tome hello> tome@hello.com').group(1))


  • 1

Reply