fork download
  1. import re
  2. text = r'k8s-configuration-int-mbus_config-int-mbus-deployment-db9c64cd-n4tww_central_6d499584'
  3. rx = r'^.*?(?=-(?:[A-Za-z]+[0-9]|[0-9]+[a-zA-Z])[0-9a-zA-Z]*-)'
  4. match = re.search(rx, text)
  5. if match:
  6. print(match.group())
Success #stdin #stdout 0.03s 9620KB
stdin
Standard input is empty
stdout
k8s-configuration-int-mbus_config-int-mbus-deployment