You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
365 B
10 lines
365 B
# coding=utf-8
|
|
import re
|
|
|
|
with open('1.txt', 'r') as myfile:
|
|
data=myfile.read()
|
|
|
|
r = re.compile(r"^[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*@([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?\.)*(aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|[a-z][a-z])$")
|
|
|
|
n = re.compile(r'\w+$')
|
|
print r.findall(data)
|
|
|