0
<td>
 <asp:TextBox id="email" class=smallV runat=server columns=50 />
 </td>
 <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ValidationExpression="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" ErrorMessage="Please enter a valid E-mail ID"  ControlToValidate="email" class="rField" display="dynamic">
 </asp:RegularExpressionValidator>

If I test with abc@xyz.com, abc.xyz@abc.com all are failing why ?

Alan Moore
  • 73,866
  • 12
  • 100
  • 156

1 Answers1

0

Regex for Email ID:-

\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

As per the documentation from here IOS and many other browsers don't yet support it.

So that won't work in any of the IOS related devices

Main reason may that it is HTML 5 compliant.

hard luck

Nad
  • 4,605
  • 11
  • 71
  • 160
  • What generic client side email validation mechanism (in a textbox) can I use that will work across all OSs and browsers??? – manasi arora Jan 11 '16 at 09:03
  • @manasiarora: it wont work on any `OS devices` other than that you can check the link which I mentioned. It clearly states that which browser its support and which not – Nad Jan 11 '16 at 09:27
  • I have two more regular expression validators in the same page. Why are they working just fine?? I'm sorry... but i'm very confused about this random behaviour.. that too only on a tab. Its working fine on an Apple laptop!!! – manasi arora Jan 11 '16 at 10:29
  • i do not have any idea untill and unless we have the whole code to rectify. On other hand. the issue might be something related to IOS only which they dont support. – Nad Jan 11 '16 at 10:35
  • what was the issue, also marked the answer if it helped you. – Nad Jan 11 '16 at 13:56
  • @manasiarora: if your query is resolved with that `regex` you can accept it as answer, so that it can help others – Nad Jan 12 '16 at 07:18