forum

home / developersection / forums / how to c# and javascript email validation regex

How to C# and javascript email validation regex

Norman Reedus 2280 18-Jan-2015

I have ASP.NET project and I need to check is email correct or not. I always using that script, but it fails with asp.net, because @ is bad symbol.

function emailvalidate(e)
{
    var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/;
    return b.test(e);
}

How can I fix this? And its important to check email by JavaScript, not ASP.NET or C#.

P.S. Im really new with ASP.NET and JavaScript RegEx.


Updated on 18-Jan-2015
Can you answer this question?

Answer

1 Answers

Liked By