首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

举一个python re文档的例证

2013-10-14 
举一个python re文档的例子Some characters, like | or (, are special. Special characters either s

举一个python re文档的例子
Some characters, like '|' or '(', are special. Special characters either stand for classes of ordinary characters, or affect how the regular expressions around them are interpreted. Regular expression pattern strings may not contain null bytes, but can specify the null byte using the \number notation, e.g., '\x00'.

谁能写两个例子出来表达下上面的意思呀?特别是最后一句话。另外特殊字符需要转义这个知道,\x00不懂。
[解决办法]


>>> s='\x00'+r'\\'
>>> re.findall(r'[\x00\x5c]',s)
['\x00', '\\', '\\']

热点排行