import re
emails= [s for s in input().split(',')]
emails_lst= [[str(x) for x in range(2)] for y in range(len(emails))]
for i in range(len(emails)):
emails_lst[i][0]= emails[i]
for j in range(len(emails_lst)):
double_pattern= r'[.+_-]{2}' #先檢查有沒有符號連續出現2次
if re.search(double_pattern, emails_lst[j][0]):
emails_lst[j][1]= False
else:
emails_lst[j][1]= True
mail_pattern= r'^[^.+_-][\w.+-]+@[0-9a-zA-Z]+.([0-9a-zA-Z]+|[0-9a-zA-Z]+.[a-zA-Z]+)$'
if re.match(mail_pattern, emails_lst[j][0]): #從首字開始匹配項目
emails_lst[j][1]= True
else:
emails_lst[j][1]= False
ans= [emails_lst[l][1] for l in range(len(emails_lst))]
print(ans)
提交連結
https://judge.ccclub.io/status/65ab9e8fe829b603810fbab77bf2aaa2
程式碼
錯誤訊息
WA
問題描述
您好,題目測資及其他學員提問的測資都正確,請問有什麼測資或情況是我沒有考慮到的嗎?