Skip to content

Instantly share code, notes, and snippets.

@miraclesu
Created July 27, 2013 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miraclesu/6093693 to your computer and use it in GitHub Desktop.
Save miraclesu/6093693 to your computer and use it in GitHub Desktop.
v2ex77127
#!/usr/bin/env python
# coding=utf-8
import re
ucpage = """
<div class="content" title="2013-07-25 09:09:58">
要匹配的内容
</div>
"""
pat = re.compile(r'<div.*?class="content".*?ti.*?>(.*?)</div>', re.S|re.M)
print pat.findall(ucpage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment