title: Email Validation Ionic2
body: <p>I am building an app with Ionic2. In the app I have a form that uses formBuilder to validate each input field. I figure for the email input field I would just use Validators.pattern with a regex string. But after trying multiple different regex expression, I can't get it to work. The form says that the field is invalid even when I enter a valid email address such as 'thisisanemail@gmail.com'. The issue is not with the regex expression but with my implementation of the Validator.</p>
  
  <p>Here is my formBuilder:</p>
  
  <pre><code> this.inputGroup = this.formBuilder.group({
      fullName : ['', Validators.compose([Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*'), Validators.required])],
      email : ['', Validators.compose([Validators.required, Validators.pattern('/^(([^&lt;&gt;()\[\]\\.,;:\s@"]+(\.[^&lt;&gt;()\[\]\\.,;:\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,}))$/')])],
      subject : ['', Validators.compose([Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*'), Validators.required])],
      message : ['', Validators.compose([Validators.maxLength(500), Validators.pattern('[a-zA-Z ]*'), Validators.required])],
       });
  </code></pre>
  
  <p>Why would the Validator claim that is an email, such as the example above, is invalid? Is there a better way to do this? </p>