import re a = 'a北京ba上海ba重庆ba广州b' b = re.findall('a.*?b', a, re.S) # .*(你中间多了个空格)? print(b)
37,743
社区成员
34,212
社区内容
加载中
试试用AI创作助手写篇文章吧