Does this match need to require px in the pattern? For example, if we called parsePixelString("50mm") we would still get 50 but that is not 50 pixels. Given the function name and comment, it might be implying that you need to call this method only with strings ending in "px" so feel free to ignore this comment if that is the intention.