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