(?i)applies the following effective flags to the remainder of the pattern: gmi i modifier: insensitive. Matches without distinguishing uppercase and lowercase letters
\ban ASCII word boundary
\d+a digit, repeated at least once
\.?optionally matches the literal . (4610 / 568 / 2E16)
\d*a digit, repeated any number of times
\s*any whitespace character, repeated any number of times
Non-Capturing Group(?:kg|gr?) kgthe literal text kg (case insensitive) gthe literal g (10310 / 1478 / 6716) (case insensitive)
r?optionally matches the literal r (11410 / 1628 / 7216) (case insensitive)
\ban ASCII word boundary
g modifier: global. Finds all matches instead of stopping after the first
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string