I have the following validation:
An input where we control with a pattern that there are only 4 figures including the possibility that the figure has 0 on the left.
<input type="text" required title="Debe tener 4 digitos." pattern="\d{4}" minlength="4" maxlength="4" />
But I also need to control through pattern that this figure is within a range between 0100 and 4599 including these 2 numbers.
I personally find maintaining complex regex expensive and prefer to use them sparingly, but in this case you could do something like
Explanation
you can play with her here
Another option is to create a separate check, converting the text to a number. It's more code but easier to maintain if the bounds change: