- 编写程序,构造正则表达式判断一个字符串是否是ipv4地址。
- 使用re模块的findall方法,对给定的一批网址匹配出如下结果:
http://www.interoem.com/
http://3995503.com/
http://lib.wzmc.edu.cn/
http://www.zy-ls.com/
http://www.fincm.com/:
给定的网址为:
”http://www.interoem.com/messageinfo.asp?id=35http://3995503.com/class/class09/news_show.asp?id=14http://lib.wzmc.edu.cn/news/onews.asp?id=769http://www.zy-ls.com/alfx.asp?newsid=377&id=6http://www.fincm.com/newslist.asp?id=415”
- 编写程序,匹配合法的电子邮件地址(格式如下):
<用户名>@<电子邮件服务器名>
其中,用户名部分只允许数字、字母、下划线( _ ),且开头只能是数字或字母。