validating email address using regular expression on razor page

后端 未结 3 2286
孤城傲影
孤城傲影 2021-02-20 10:39

Hi I am using razor and trying to use regular expression to validate email address here the validation function

function validateEmail(txtEmail){
   var a = doc         


        
3条回答
  •  清歌不尽
    2021-02-20 11:16

    try this may be help you

    function validateEmail(email) { 
        var re = /^[_a-z0-9-A-Z-]+(\.[_a-z0-9-A-Z-]+)*@[a-z0-9-A-Z-]+(\.[a-z0-9-A-Z-]+)*(\.[a-z]{2,4})$/;
        return re.test(email);
    } 
    

提交回复
热议问题