|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
email validationThe following expression I am using to validate an email.
However when empty spaces entered at the end of email it is recognized as invalid email. How do I fix this problem? ^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]* [0-9a-zA-Z])*\.)+[a-zA-Z] {2,9})$ Here's an easier method....
Just go to http://regexlib.com/ and lookup "e-mail validation" and copy one of the expressions already written there. Paul Show quoteHide quote "anonymous" <anonym***@discussions.microsoft.com> wrote in message news:5bb901c523f3$bff31090$a401280a@phx.gbl... > The following expression I am using to validate an email. > However when empty spaces entered at the end of email it > is recognized as invalid email. How do I fix this problem? > ^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]* > [0-9a-zA-Z])*\.)+[a-zA-Z] > {2,9})$ I could not find any expression which will validate email
liek this: <em***@msn.com >. As you can see I have some empty spaces after actual email and I can't find the expression to validate email as well as taking the space out. Thanks You could always do a trim on the email field
Show quoteHide quote "anonymous" <anonym***@discussions.microsoft.com> wrote in message news:5bb901c523f3$bff31090$a401280a@phx.gbl... > The following expression I am using to validate an email. > However when empty spaces entered at the end of email it > is recognized as invalid email. How do I fix this problem? > ^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]* > [0-9a-zA-Z])*\.)+[a-zA-Z] > {2,9})$ I am a little bit confused...here is my code... where I
should trim??? <asp:RegularExpressionValidator id="reEmail" runat="server" CssClass="error_message" ErrorMessage="You must enter a valid Email address." ControlToValidate="txtEmailAddress" ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@ (([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9}) $"></asp:RegularExpressionValidator>
Hyperlink Format
Newbie Question on Web DataGrid Focus DataGrid Export to Excel How can I format a telephone # in the datagrid Sorting Datagrid With Hyphen / Dash How to read Column0 from DataGrid Modify rows in DataTable Row Span in a grid? Changing text to a textbox control in row 5 of a datagrid Help needed with DataGrid Client-Side Scripting |
|||||||||||||||||||||||