摘要: 转~下面列出Python正则表达式的几种匹配用法:此外,关于正则的一切http://deerchao.net/tutorials/regex/regex.htm1.测试正则表达式是否匹配字符串的全部或部分regex=ur"" #正则表达式 if re.search(regex, subject): do_something() else: do_anotherthing() 2.测试正则表达式是否匹配整个字符串regex=ur"\Z" #正则表达式末尾以\Z结束 if re.match(regex, subject):  &nb 阅读全文
posted @ 2011-06-29 06:12 cactuswisper 阅读(702) 评论(0) 推荐(0) 编辑