I would like to know how a range of ports can be filtered with pattern so that it only accepts either numbers or numbers with a colon in the middle and, given that it does not exceed 65535.
Example: 20 or 20:25
The only thing that has occurred to me has been this filter pattern="[0-9]{1,5}" the only thing it does is limit numbers of no more than five figures
For it to allow you to enter either a number or two numbers separated by
:
, just complete your pattern<puerto>
so that it is<puerto>(:<puerto>)?
:():So that it doesn't allow entering numbers greater than 65535, it's more complicated, but not impossible with a bit of ingenuity:
Now it only remains to combine both in
(<puerto>)(:(<puerto>))?
: