fork download
  1. import re
  2. s = 'travel to africa x 2\ asia x 2\ europe x 2\ Airport pick up included. Furnitures 3 seater couch x 1 4 seater+ couch x 1 < 60 inches TV x 1 60 inches+ TV x 1 Washer - front loader x 1 Box / bag / misc x 1 The maximum clearance is 1.5m.'
  3. print(re.findall(r'(.*?)\s+x\s*(\d+)', s))
  4. print(re.findall(r'(\S.*?)\s+x\s*(\d+)', s))
Success #stdin #stdout 0.02s 27728KB
stdin
Standard input is empty
stdout
[('travel to africa', '2'), ('\\ asia', '2'), ('\\ europe', '2'), ('\\ Airport pick up included. Furnitures 3 seater couch', '1'), (' 4 seater+ couch', '1'), (' < 60 inches TV', '1'), (' 60 inches+ TV', '1'), (' Washer - front loader', '1'), (' Box / bag / misc', '1')]
[('travel to africa', '2'), ('\\ asia', '2'), ('\\ europe', '2'), ('\\ Airport pick up included. Furnitures 3 seater couch', '1'), ('4 seater+ couch', '1'), ('< 60 inches TV', '1'), ('60 inches+ TV', '1'), ('Washer - front loader', '1'), ('Box / bag / misc', '1')]