Hi,
First I would like to say I really like this book. Thanks.
I am having trouble with the reusable function. The email address is coming out false everything looks okay to me.
Code:
@using System.Text.RegularExpressions;
@functions {
public static bool IsValidEmail(string s)
{
string pattern = @"^[\w-\.]+@ ([\w-]+\.)+[\w-]{2,4}$";
return Regex.IsMatch(s,pattern);
}
}
Please help. Thanks.