re.search实例
https://github.com/crifan/BlogsToWordpress/blob/master/libs/crifan/blogModules/BlogCsdn.py
从内容中
提取csdn帖子的标题
foundTitle = re.search('<span class="link_title"><a href="[\w/]+?">\s*(<font color="red">\[置顶\]</font>)?\s*(?P<titleHtml>.+?)\s*</a>\s*</span>', html, re.S)
titleHtml = foundTitle.group("titleHtml")
logging.debug("titleHtml=%s", titleHtml)
详见:
https://github.com/crifan/BlogsToWordpress/blob/master/libs/crifan/blogModules/BlogCsdn.py
或
</a>
</span>
提取出