求助啦
我有道很重要的题没有弄明白,希望能得到在家的帮助:
写一个函数,能区分是否是正规的email格式,用C#这么写可以么这么写可以么
using System.Text.RegularExpressions;
//检查Email是否符合规范
public static bool CheckEmail(string Email)
{
string strExp = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
Regex r = new Regex(strExp);
Match m = r.Match(Email);
if(m.Success)
{
return true;
}
else
{
return false;
}
}
我还想把它转为用JAVA来写,不知道完整的应该怎么写呢,帮帮我啊。。谢谢