Created
January 2, 2017 03:41
-
-
Save asciant/90e7d268da1e85be6856413f03ee3f75 to your computer and use it in GitHub Desktop.
RegEx Validator angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emailRegex = /^[a-z0-9!#$%&'+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-][a-z0-9])?(.a-z0-9?)*$/i; | |
registration : FormGroup; | |
constructor(r: FormBuilder, public http :Http){ | |
this.registration = r.group({ | |
'chosen_username' : [null, Validators.required], | |
'chosen_email' : [null, Validators.pattern(this.emailRegex)], | |
'chosen_password' : [null, Validators.required], | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment