var emailReg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
This is my regular expression . it accepts the email such as
name.name_@__domain.in
How can i format my regular expression which accepts only a valid email format only. I need the email validation for above example.it is not a duplicate one.
Andrea says: Hi @josmi, Please try the following Regular Expression Validator to validate Valid Internet URL format It might help you. Cheers Andrea.
Hi @josmi, Please try the following Regular Expression Validator to validate Valid Internet URL format It might help you. Cheers Andrea.
when click on this link..it navigates to another ask question page
Hi,
Please refer below article
I hope this will help you out.
var emailReg= /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
the expression you prefer accepts ...name@domain.com
Here I have created sample that will help you out.
HTML
<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script type="text/javascript"> function IsValidEmail(email) { var expr = /^(\w+)([\.])(\w+)@(\w+)([\.])in$/; return expr.test(email); }; function ValidateEmail() { var email = document.getElementById("txtEmail").value; if (!IsValidEmail(email)) { alert("Invalid email address."); } else { alert("Valid email address."); } } </script> </head> <body> <form id="form1"> <input type="text" id="txtEmail" /> <input type="button" id="btnValidate" value="Validate Email" onclick="ValidateEmail()" /> </form> </body> </html>
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.