I have a 'PIN' number field I want to require 4 or 5 digits. Using the Add Pattern Validation box for the input box I put in the following RegEx: ^[0-9]{4,5}$
This fails to reject (red box) if I enter any valid number in the field. If I change the field to a TEXT input it works. Not really an issue since the RegEx forces only numerals but do regex pattern validations work on Number fields? If not, why prompt for it when it does nothing?
Thanks... I re-read: https://support.wix.com/en/article/working-with-user-input-validation-in-the-settings-panel and it indicates one can use pattern validation on number fields...but the regex that works for a text field does not work for a number field. Just a bug?
You can find out more about it here.
https://support.wix.com/en/article/working-with-user-input-validation-in-the-settings-panel
However, your code looks okay as for a number between 4 and 6 it should be this - ^[0-9]{4,6}$ - and that can be shortened to just - ^\d{4,6}$ - if Wix accept it shortened.
Also, have a look at this site here as it might help you out if you are planning on doing a lot of Regex work.
https://regex101.com/
You will see that ^\d{4,5}$ and ^[0-9]{4,5}$ works fine there and should be okay.