抽取固定字符串之间的内容
#抽取满的数据
def extract_full_numbers(text):
# 定义正则表达式模式,匹配“满”和“返”之间的数字
pattern = r'满(\d+)返'
# 使用re.findall来查找所有匹配的内容
matches = re.findall(pattern, text)
#转为int
matches_i = [int(tmatch) for tmatch in matches]
return sorted(matches_i)
正则表达式案例操作
使用正则表达式替换特殊字符
chrome-error://chromewebdata
判断正则表达式中是否包含数字
https://blog.youkuaiyun.com/yimenren/article/details/104697718/
正则匹配表达只保留数字
https://www.cnblogs.com/lion-zheng/p/8056222.html
int(re.sub("\D","","123*ab"))