Fix rails regressions.
Use email regex from Devise. Fixes #5368