先說效果:AVVBCCC 匹配出 VVACCCCCD 匹配出CCCCCD單獨(dú)實(shí)現(xiàn)我都會第一種# -*- coding: utf-8 -*-import re#str = 'AVVBCCC'forword = re.search(r'A(.*)B', str).group(1)
print(forword)第二種# -*- coding: utf-8 -*-import re#str = 'ACCCCCD'forword = re.search(r'A(.*)', str).group(1)
print(forword)請問怎么合起來寫?
- 1 回答
- 0 關(guān)注
- 1390 瀏覽
添加回答
舉報(bào)
0/150
提交
取消