(1)
import re
string =input()
# 任务:采用re库函数,对string分别进行邮箱地址、网址提取,
# 将邮箱地址依次分行显示
# ********** Begin *********#
#分别生成对应正则表达式对象
regex1 = re.compile(r'\w+@\w+.\w+')
regex2 = re.compile(r'ht{2}ps://w{3}.\w+.\w+')
res = regex1.findall(string)
if len(res):
print('提取邮箱地址如下:')
for i in res:
print(i)
res1 = regex2.findall(string)
if len(res1):
print('提取网址如下:')
for i in res1:
print(i)
# ********** End **********#
(2)
import re
string =input()
# 任务:采用re库函数,对string分别进行密码格式认证提取,
#验证输入密码符合要求(8位以上,字母开头,只能是字母、数字、下划线)
# ********** Begin *********#
#提取密码代码,密码中包含字母、数字、下划线
print("提取密码是")
p = re.compile('[a-z]|[A-Z]|_|\d')
t = re.findall(p,string)
if t:
for i in t:
print(i,end="")
# ********** End **********#