Pad number with variable length zeroes using REGEX
问题 I have a situation where client inputs a number, and I need to validate that number by padding a certain number of zeroes in front of it. The max length of the field that I validate is 9 digits, so if client enters '123', I need to pad it with 6 zeros in front of it and validate. Sounds easy enough, right? Well, here is the kicker, I have no code-control over any part of the process. The only things available to me are 2 'properties' - a regex pattern and a regex replace that already existing