Could you help me constraint a phone number to both 9 and 10 digits phone numbers with regex?

Hi @Kal_Lam

We do have phone numbers of both 9 and 10 digits here. for now i’ve used this regex(.,‘^[0-9]{10}$’) which only allows me to enter 10 digits. could you please help me putting constraints to both 9 and 10 digits phone numbers in a single regex.

Hi @Hems and welcome to the community!


Should work for you.

1 Like

@hakan_cetinkaya Thank you it worked!


Welcome @Hems,
You may always use the search function of this forum to find help, e.g. your topic has been discussed here about 20 times: Search results for 'phone number regex' - KoboToolbox Community Forum
Also, often the Help Centre articles provide support, e.g. and

1 Like