python正则表达式findall通配符如何多个条件匹配字符串

"cat Tom 123 and mouse Jerry 456",如这个字符串,我们想用通配符找出TomJerry

import re
text = "cat Tom 123 and mouse Jerry 456"
matches = re.findall("(?:cat |mouse )(.*?)(?: 123| 456)", text)
print(matches)  # ['Tom', 'Jerry']

归功于:(?:...)是一个非捕获组,不会保存下来