I have a bunch of values representing weight… Some of them are ambiguous, like combining weight and external dimensions of the package, and some don’t contain the measurement unit. What I want is to take those ambiguous values out.
So I came up with this regex pattern ^[d.kg ]+$
that does that, but misses some cases. So from the list here https://regex101.com/r/3SwCuf/1 it also matches plain numbers (line 3 and 9).
Basically what I want it to match is a decimal number, followed by a white-space (not necessarily) and the measuring unit (either kg or g). Nothing more, nothing less.