(2018-04-16.Python从Zero到One)五、正则表达式__5.1.10小练习

上一篇文章为:→5.1.9python贪婪和非贪婪

小练习

1. 匹配网址

有一批网址:

http://www.interoem.com/messageinfo.asp?id=35
http://3995503.com/class/class09/news_show.asp?id=14
http://lib.wzmc.edu.cn/news/onews.asp?id=769
http://www.zy-ls.com/alfx.asp?newsid=377&id=6
http://www.fincm.com/newslist.asp?id=415

需要 正则后为:

http://www.interoem.com/
http://3995503.com/
http://lib.wzmc.edu.cn/
http://www.zy-ls.com/
http://www.fincm.com/

2. 找出单词

有一句英文如下:

hello world ha ha

查找所有的单词


下一篇文章为:→1.1.0数据结构与算法(Python)

你可能感兴趣的:((2018-04-16.Python从Zero到One)五、正则表达式__5.1.10小练习)