fork download
  1. import re
  2. text = "18-02-202010:44:48PEDMILANO OVEST- BINASCOA1,40"
  3. print( re.sub(r'^\d{2}-\d{2}-\d{5,6}:\d{2}:\d{2}(.*?)\d+(?:,\d+)?$', r'\1', text) )
  4. print( re.sub(r'^\d{2}-\d{2}-\d{5,6}:\d{2}:\d{2}|\d+(?:,\d+)?$', '', text) )
  5. m = re.search(r'^\d{2}-\d{2}-\d{5,6}:\d{2}:\d{2}(.*?)\d+(?:,\d+)?$', text)
  6. if m:
  7. print( m.group(1) )
Success #stdin #stdout 0.02s 9476KB
stdin
Standard input is empty
stdout
PEDMILANO OVEST- BINASCOA
PEDMILANO OVEST- BINASCOA
PEDMILANO OVEST- BINASCOA