title: How to use regular expression in angularjs
body: <p>I have tried this code..</p>
  
  <pre><code>&lt;script&gt;
    angular.module('emailExample', [])
      .controller('ExampleController', ['$scope', function($scope) {
        $scope.text = 'me@example.com';
      }]);
  &lt;/script&gt;
    &lt;form name="myForm" ng-controller="ExampleController"&gt;
      Email: &lt;input type="email" name="input" ng-model="text" required&gt;
      &lt;span class="error" ng-show="myForm.input.$error.required"&gt;
        Required!&lt;/span&gt;
      &lt;span class="error" ng-show="myForm.input.$error.email"&gt;
        Not valid email!&lt;/span&gt;
      &lt;tt&gt;text = {{text}}&lt;/tt&gt;&lt;br/&gt;
      &lt;tt&gt;myForm.input.$valid = {{myForm.input.$valid}}&lt;/tt&gt;&lt;br/&gt;
      &lt;tt&gt;myForm.input.$error = {{myForm.input.$error}}&lt;/tt&gt;&lt;br/&gt;
      &lt;tt&gt;myForm.$valid = {{myForm.$valid}}&lt;/tt&gt;&lt;br/&gt;
      &lt;tt&gt;myForm.$error.required = {{!!myForm.$error.required}}&lt;/tt&gt;&lt;br/&gt;
      &lt;tt&gt;myForm.$error.email = {{!!myForm.$error.email}}&lt;/tt&gt;&lt;br/&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>But getting issue in validation. Say if i try to enter 'a@a.c' in email then it will not show any error. Please help me on this.</p>