I am trying to use the below Email Address pattern in 
http://www.regular-expressions.info/email.html

\A[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\z

My code:

<input type="email" name="email" ng-model="email" 
ng-pattern="/^[a-z0-9!#$%&amp;'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&amp;'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/"
 id="email-1" value="" required="" class="ng-pristine ng-untouched ng-empty 
ng-valid-email ng-invalid ng-invalid-required ng-valid-pattern">

This is case sensitive. 


I tried using 'i' modifier. 

"/^[a-z0-9!#$%&amp;'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&amp;'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i"

However, it still wouldn't accept capitalized character (shows invalid 
email error message).


I came across https://github.com/angular/angular.js/issues/1437. However, I 
am using a later version (1.2).


I also tried A-Z, no luck with that either.

"/^[A-Za-z0-9!#$%&amp;'*+\/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&amp;'*+\/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/"

How to make this pattern case insensitive?

Thank you for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to