Discuss / Python / py 正则表达式

py 正则表达式

Topic source
def is_valid_email(addr):
    pattern=r'(\w\.)*[\w]+@[\w]+\.com'
    if re.match(pattern,addr):
        return True
    return False
print(is_valid_email('n.gates@microsoft.com'))

  • 1

Reply