Added an escape (\) for the dot (.) in e-mail pattern: r'^[\w.-]+@[\w-]+\.[\w.]+$'. The missing escape (\) for the dot (.) causes username@company to be accepted, which shouldn't be.