Regular expression formula

I’m looking for a regular expression form to authorize data collectors to enter only ( numbers from 0-10 and NA for non applicable cases )
Thanks

Hi @Ahmed.Seliem
Have you had a look at the following article

Kindly have a look and then try working out your regex.

Stephane

1 Like

Hello @Ahmed.Seliem,
If this is rather limited choices, why not use a select_one type with 0… 10 and NA?
Userfriendly advantage (KoBoCollect): You directly control correct entry, instead of coming delayed with contraint message (based on regex).

2 Likes

Hi @Ahmed.Seliem,

Try following our support article outlined by @stephanealoo. It should help you design regex with a lot of practical examples. At the same time you could also do it as outlined by @wroos. It’s a simple method and would not require regex. However, if you wish to do it using the regex, you could do it as outlined in the image shared below:

In the survey tab of your xlsform:

Data entry screen as seen in Enketo: when a wrong entry is made

Data entry screen as seen in Enketo: when a correct entry is made

Data entry screen as seen in Enketo: when a wrong entry is made

Data entry screen as seen in Enketo: when a correct entry is made

Reference xlsform:

Regex_Constraint.xlsx (9.9 KB)