📅  最后修改于: 2022-03-11 14:45:34.645000             🧑  作者: Mango
>>> re.search(r'(?P[^-]+)-(?P\d.\d.\d-\d+).tar.gz', 'package_name-1.2.3-2004.tar.gz').groupdict()
{'name': 'package_name', 'ver': '1.2.3-2004'}