fork download
  1. import re
  2. text = "3x130-140k-ZZ-ABC"
  3. m = re.search(r"^.*?(?=-[A-Za-z])", text)
  4. if m:
  5. print(m.group())
  6.  
Success #stdin #stdout 0.03s 9496KB
stdin
Standard input is empty
stdout
3x130-140k