Skip to content

Commit

Permalink
fix(validator): change email regex to: http://emailregex.com/
Browse files Browse the repository at this point in the history
  • Loading branch information
Newan authored and lexzhukov committed Mar 9, 2017
1 parent d117e84 commit 4470607
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/theme/validators/email.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 4470607

Please sign in to comment.