摘要: 摘要: re模块包括操作正则表达式的函数,一些工作中都需要用到,现在说明下使用方法。使用说明:一,re模块下的函数: 函数 描述compile(pattern)创建模式对象search(pattern,string)在字符串中寻找模式match(pattern,string) 在字符串开始处匹配模式split(pattern,string)根据模式分割字符串findall(pattern,string)列表形式返回匹配项sub(pat,repl,string)pat匹配想用repl替换escape(string)特殊字符转义1,compile:>>> import re> 阅读全文
posted @ 2013-06-28 19:27 jyzhou 阅读(24526) 评论(1) 推荐(0) 编辑