In [1]:
import re
In [2]:
s = 'aaa@xxx.com, bbb@yyy.com, ccc@zzz.net'
In [3]:
m = re.match(r'[a-z]+@[a-z]+\.com', s)
print(m)
In [4]:
m = re.match(r'[a-z]+@[a-z]+\.net', s)
print(m)
In [5]:
s = 'aaa@xxx.com, bbb@yyy.com, ccc@zzz.net'
In [6]:
m = re.search(r'[a-z]+@[a-z]+\.net', s)
print(m)
In [7]:
m = re.search(r'[a-z]+@[a-z]+\.com', s)
print(m)
In [8]:
s = 'aaa@xxx.com'
In [9]:
m = re.fullmatch(r'[a-z]+@[a-z]+\.com', s)
print(m)
In [10]:
s = '!!!aaa@xxx.com!!!'
In [11]:
m = re.fullmatch(r'[a-z]+@[a-z]+\.com', s)
print(m)
In [12]:
s = '!!!aaa@xxx.com!!!'
In [13]:
m = re.match(r'[a-z]+@[a-z]+\.com$', s)
print(m)