1
zhy0216 2013 年 11 月 18 日 |
2
yxjxx 2013 年 11 月 18 日 我也刚学python不久,写过一篇笔记. http://yxjxx.me/regular-expression
|
3
mengzhuo 2013 年 11 月 18 日 首先网页就不要用正则提取内容,BS4是你的好伙伴
然后提取的所有链接再用正则匹配 https?:\/\/([\d\.]+)\/ |
4
Perry 2013 年 11 月 19 日 关于入门:
入门正则可以不用书 几分钟的入门:http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/ cheatsheet:http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/ 然后发挥你的想象力自己写并验证:http://rubular.com |
6
sandtears 2013 年 11 月 19 日 import re
tmpRe = re.compile(r"^http://.*?(\d+)$") tmpNum = tmpRe.match(url).groups()[0] 此时tmp即为str类型的数字 |
7
clino 2013 年 11 月 19 日 建议装一个 kodos ,是一个正则的调试集成环境
|
8
lixm 2013 年 11 月 19 日
html页面为什么不用xml解析而要去用正则呢?
|
10
C0VN 2013 年 11 月 19 日 |