email validation

A

anonymous

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})$
 
A

anonymous

I could not find any expression which will validate email
liek this:
<[email protected] >.
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
 
A

anonymous

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top