The length constraint doesn't work with the regular expression

Hello,

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.

Thanks.

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
https://support.kobotoolbox.org/restrict_responses.html#how-do-i-build-the-regex-that-i-need
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?