import re
from django.core.validators import RegexValidator

# User email
validate_staff_email = RegexValidator(
    regex=re.compile(r'\w+@gmail.com'),
    message='请输入有效的公司邮箱'
)


if __name__ == '__main__':
    print(validate_staff_email.regex)
    print(validate_staff_email(f'abc@def.com'))
    print(validate_staff_email(f'abc@gmail.com'))

81e45fd854345f104c7b881261c7a588f77f6f6f
<mask token>

<mask token>
if __name__ == '__main__':
    print(validate_staff_email.regex)
    print(validate_staff_email(f'abc@def.com'))
    print(validate_staff_email(f'abc@gmail.com'))

<mask token>
validate_staff_email = RegexValidator(regex=re.compile('\\w+@gmail.com'),
    message='请输入有效的公司邮箱')
if __name__ == '__main__':
    print(validate_staff_email.regex)
    print(validate_staff_email(f'abc@def.com'))
    print(validate_staff_email(f'abc@gmail.com'))

import re
from django.core.validators import RegexValidator
validate_staff_email = RegexValidator(regex=re.compile('\\w+@gmail.com'),
    message='请输入有效的公司邮箱')
if __name__ == '__main__':
    print(validate_staff_email.regex)
    print(validate_staff_email(f'abc@def.com'))
    print(validate_staff_email(f'abc@gmail.com'))

import re
from django.core.validators import RegexValidator

# User email
validate_staff_email = RegexValidator(
    regex=re.compile(r'\w+@gmail.com'),
    message='请输入有效的公司邮箱'
)


if __name__ == '__main__':
    print(validate_staff_email.regex)
    print(validate_staff_email(f'abc@def.com'))
    print(validate_staff_email(f'abc@gmail.com'))
