I’m trying to write a constraint that would enable respondents to enter a code we send them via email in order to match their post survey with a pre survey.
An example of the 18-digit code is:
AMPS-HK-2020-0710-1233
The first four digits need to be alphanumeric, the next 2 uppercase letters, the rest numbers.
I’ve progressed this far based on regex codes for but it doesn’t seem to work. I keep getting the constraint message.
regex(., ’^[a-zA-Z0-9]{4}[-][a-zA-Z]{2}[-][0-9]{4}[-][0-9]{4}[-][0-9]{4})$’)
This will be a survey on Enketo and I’ve been consulting this page: https://support.kobotoolbox.org/restrict_responses.html)
Thank you.