开发者

adding apostrophe while checking email address

I am new to regular expression. I want to allow an apostrophe (') to be allowed while validating email address. I have a regular expression as one given below:

 private static Regex emailRegex = new Regex(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
         @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" 开发者_如何学Go+ 
         @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")

What changes should i have to do in the above regex to allow (')?


private static Regex emailRegex = new Regex(@"^([a-zA-Z0-9\'_\-\.]+)@((\[[0-9]{1,3}" +
         @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + 
         @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜