求助啦

jiamingdsq 2007-11-27 10:04:42
我有道很重要的题没有弄明白,希望能得到在家的帮助:

写一个函数,能区分是否是正规的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来写,不知道完整的应该怎么写呢,帮帮我啊。。谢谢
...全文
61 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧