正则表达式对不同网址的写法
正则表达式 re.compile(r'/view/\d+\.htm'),如果换成360百科或维基百科,括号里面要怎么改呢?
360百科:http://baike.so.com/doc/1790119-1892991.html
维基百科:https://en.wikipedia.org/wiki/Python
正则表达式 re.compile(r'/view/\d+\.htm'),如果换成360百科或维基百科,括号里面要怎么改呢?
360百科:http://baike.so.com/doc/1790119-1892991.html
维基百科:https://en.wikipedia.org/wiki/Python
2016-09-22
http://baike.so.com/doc/1790119-1892991.html同样是分两部分 http://baike.so.com/doc/和1790119-1892991.html直接匹配后面的就可以 r'\d{7}-\d{7}\.html'
举报