I need to define something similar to this regex:
[0-9]{1, 5}
On a PrimeFaces element:
You could use a validator. Or the validaterange and define a minimum and maximum.