I'm trying to write a regex to capture any measurement unit in a string, considering that the unit can be before or after the number.
What I came up for the moment are two regex.
/\d*\.?,?\d+\s?(kg|g|l)/gi that matches with
ABC 200g
EFG 5,4 Kg
HIL 2x20l
And (kg|g|l)\s?\d+,?\.?d* that matches with:
ABC g200
EFG kg 5,4
HIL l 20x2
How can I join the two regex to match with both:
ABC g200
EFG 5,4 Kg