i use the following regex to extract values that appear before certain units:
([.\d]+)\s*(?:kg|gr|g)
What i want, is to include the unit of that specific value for example from this string :
"some text 5kg another text 3 g more text 11.5gr end"
i should be getting :
["5kg", "3 g", "11.5gr"]
can't wrap my head on how to modify the above expression to get the wanted result. Thank you.