I want to replace certain characters in a string like below:
Input string:
s = "1kgbutter2kilochilli30gmssalt"
Output string:
s = " 1kg butter 2kilo chilli 30gms salt"
I have tried using re.sub like below but no luck.
re.sub(r"^[0-9]*(kg|kilo|gm)s$", "*how do i add spaces if exp matches*", s)