kakwa / ldapcherry

Web UI for managing users and groups in multiple directory services.
MIT License
225 stars 70 forks source link

Email regex does not match user.name-secondname@domain.com #64

Open marvin1973 opened 4 years ago

marvin1973 commented 4 years ago

Email regex does not match user.name-secondname@domain.com oder an other Adresse with valid "-" before @

It should be

def _is_email(self, email):
    pattern = r'[\-\.\w]+@[-\.\w]+\.\w+'
    if re.fullmatch(pattern, email):
        return True
YohanRodriguezMDM commented 4 years ago

Same error here with user.name@twopart-domain.com

YohanRodriguezMDM commented 4 years ago

On gmail you could also have an email address like user+label@gmail.com, so character '+' should be added to the regex