📅  最后修改于: 2022-03-11 14:47:06.247000             🧑  作者: Mango
# credit to the Stack Overflow user in the source link
import re
text = 'gfgfdAAA1234ZZZuijjk'
m = re.search('AAA(.+?)ZZZ', text)
if m:
found = m.group(1)
# found: 1234