LoginSignup
2
2

More than 5 years have passed since last update.

Python Django 日本のキャリアメールがEmailValidatorで弾かれるケースの対処法

Last updated at Posted at 2014-08-13
# coding: utf-8
import re
from django.core.validators import EmailValidator


class JapaneseEmailValidator(EmailValidator):
    user_regex = re.compile(
        r"(^[-.!#$%&'*+/=?^_`{}|~0-9A-Z]+$"  # dot-atom (\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*を省略
        r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)',  # quoted-string
        re.IGNORECASE)
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2