The length constraint doesn't work with the regular expression


I’m creating my form and I want the user to only be able to enter 8 digits, from 0 to 9. I’m using the regex(., ‘^[0-9]{8}$’) for the validation criteria, but when I test it, it’s not working. It allows me to enter more numbers, i’m using Android.

Please,I need your help.


Hi @zenvan and welcome to the community!

Are you using KoBoCollect App in android?

1 Like

Hi @hakan_cetinkaya

Yes, i’m using KoboCollect App.

Welcome @zenvan,
You may also study these Help Center articles, please, incl. regex examples
Number, Decimal and Range Question Types — KoboToolbox documentation.
Often, the search function of this forum can provide help too, e.g. Search results for 'phone number 8 digits' - KoboToolbox Community Forum.

1 Like

@zenvan, did you also change the appearance to numbers?