学习笔记(07):零基础搞定Python数据分析与挖掘-正则表达式的简介

立即学习:https://edu.csdn.net/course/play/6861/326747?utm_source=blogtoedu

正则表达式(re-regular expression)使用场景:子串位置不固定内容多变

查找findall(pattern, string, flags=0)

flags: re.I大小写不敏感 re.M多行匹配 re.S匹配任意字符

替换sub(pattern, repl, string, count=0, flags=0)

count:最多替换次数

分割split(pattern, string, maxsplit=0, flags=0)

maxsplit:最大切割次数

发布了15 篇原创文章 · 获赞 1 · 访问量 158

猜你喜欢

转载自blog.csdn.net/weixin_42812109/article/details/104654646
今日推荐