I made my own library for this, it uses flags to control what's allowed. This is my first time really using regex, and my first Python library, so apologies if I did anything badly. It supports negative numbers and decimals, and can either allow or prevent leading zeroes (ex. 01).
Apologies too for the somewhat neglected repository, I couldn't make a directory in the browser and didn't wanna use git cli. If you want the source code, it's probably better to use the PyPI source distribution.