phoenix13

导航

 

2013年3月21日

摘要: 好文http://luy.li/2010/05/12/python-re/ python的正则表达式 re1 match 返回True falsem = re.match(r'(\d+):(\d+)$', range)2 findall 返回一个listdoc = re.findall(r'[\x80-\xff]+',line) 匹配用GBK (GB2312/GB18030)编码的所有汉字和标点符号3 按空格分词。只有中文、中文标点、数字、字母,除此之外的字符都会被作为分隔符忽略,包括标点英文标点。word=re.findall(r'[a-zA-Z0-9 阅读全文
posted @ 2013-03-21 14:28 phoenix13 阅读(268) 评论(0) 推荐(0) 编辑