【第7章】像高手一样玩转数据

7.1 文本字符串

7.1.1 Unicode
7.1.2 格式化
7.1.3 使用正则表达式匹配

python group()分组:http://www.cnblogs.com/kaituorensheng/archive/2012/08/20/2648209.html
Python入门篇之正则表达式:http://www.jb51.net/article/56436.html
(“filename = re.sub(r'\d*/','',filename)”中的 '\d*/':匹配/前的所有字母)
re.sub作用:https://www.crifan.com/python_re_sub_detailed_introduction/

1.使用match() 准确匹配

2.使用search() 寻找首次匹配

3.使用findall() 寻找所有匹配

4.使用split() 按匹配切分

5.使用sub() 替换匹配

6.模式:特殊的字符

7.模式:使用标识符

8.模式:定义匹配的输出

7.2 二进制数据

7.2.1 字节和字节数组
7.2.2 使用struct转换二进制数据









猜你喜欢

转载自blog.csdn.net/ywp_2016/article/details/77162161