import re
texts = ['The 3rd box marked 4 cannot exceed 7.34kg but if its exact 8.42kg its okay too',
	'The 3 boxes with red on them must not exceed -23.4435kg and don\'t pick them up.',
	'Parcels that can be sent are limited by 1,402kg and its okay to send',
	'The 2 boxes on the shelf must not exceed: \n102 kg',
	'Do not pick up 18 boxes at a time and make sure they cannot exceed,: 92302 k.g',
	'Do not pick up boxes that weight 56.23 kg',
	'Boxes cannot exceed -23 k/g',
	'must not exceed -23.4435kg']

rx = re.compile(r'\b((?:must\s+|can)not\s+exceed|limited\s+by)\W*?(-?\d+(?:,\d+)*(?:\.\d+)?)\s*(kg|k\.g|k/g)\b')
for text in texts:
	print("----", text,"----")
	m = rx.search(text)
	if m:
		print(f"Phrase: {m.group(1)}")
		print(f"Number: {m.group(2)}")
		print(f"UOM: {m.group(3)}")
	else:
		print("Not matched!")