Dear community.
This is my first post. Thanks a lot for your very helpful tips.
I want to set up phone numbers limited to 9 digits with the following condition:
-
The first digit is 7
-
The second digit is either 0 or 5, or 6, or 7, or 8
-
The seven last digits can be any digit between 0 and 9
Because I want to you use this format in many questions I created a binding question named “phone” (of type ‘calculation’) with the following expression ‘[1]{1}[05678]{1}[0-9]{7}$’ The plan is to used it later like this : regex(.,${phone}) in several other questions in my form.
Unfortunately, when I test my file on this website ODK - XLSForm Online I get the following error :
Error: ODK Validate Errors:
XForm is invalid. See above for the errors.
: Invalid calculate for the bind attached to “${phone}” : Couldn’t understand the expression starting at this point: ͎[2]{1}[05678]{… in expression [3]{1}[05678]{1}[0-9]{7}$’
The following files failed validation:
${MAMII_baseline_SN} 04-03-2021_essai.xml
Result: Invalid
Please, would you mind telling me what is wrong ?