fix(validator): change email regex to: http://emailregex.com/

This commit is contained in:
Jens Nachtigal 2017-03-07 15:24:28 +01:00 committed by Lex Zhukov
parent d117e8471c
commit 4470607ab2

View file

@ -3,7 +3,7 @@ import {AbstractControl} from '@angular/forms';
export class EmailValidator {
public static validate(c:AbstractControl) {
let EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
let EMAIL_REGEXP = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return EMAIL_REGEXP.test(c.value) ? null : {
validateEmail: {