Python正则表达式-group()

import re
a = "123abc456ABC"
print(re.search("([0-9]*)([a-z]*)([0-9]*)([A-Z]*)",a).group(0)) #返回整体123abc456ABC
print(re.search("([0-9]*)([a-z]*)([0-9]*)([A-Z]*)",a).group(1)) #返回前面的123
print(re.search("([0-9]*)([a-z]*)([0-9]*)([A-Z]*)",a).group(2)) #返回456