码迷,mamicode.com
首页 > 编程语言 > 详细

python正则提取关键字

时间:2017-12-14 12:01:36      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:全选   span   set   表达式   encoding   enc   int   log   find   

python使用正则表达式提取关键字

import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import re

ss = "全选?每页 20305080100 条?共6509条?第1/30条?第1/217页首页上页下页末页转"
print re.findall(u"共(.+?)条".encode(utf8),ss.encode(utf8))

 

python正则提取关键字

标签:全选   span   set   表达式   encoding   enc   int   log   find   

原文地址:http://www.cnblogs.com/anovana/p/8036726.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!