I've just embarked on my first ODK questionnaire and am slowly getting the grips on regex validation codes.
So far, I managed to create some simple regex codes, however, with the one for my beneficiary serial number I seem to be stuck.
Basically my beneficiary serial number consists of 5 building blocks that the interviewer has to create:
[year][beneficiary category][first letter of the name of the community][first three letters of the beneficiary's first name][start time of the interview]
for example: 2019JEKNIN1011
In order to avoid typing errors, I would like to "guide" the interviewers in the sense, that they only have the necessary letters or number available for each building block.
For this I have come up with this regex code:
regex(.,'^2019[EJMOP][BDFGKRS]{1}[A-Z]{3}[0-9]{4}$')
Unfortunately it doesn't work and I can't find out why. Is it the fact tat I am restricting it for only certain letters? And if so, what do I have to change for it to work?
I would greatly appreciate your help with my validation code.
Thanks!
PS: I am using Windows 10, Firefox to create the questionnaire and KoBo Collect Version v.1.14.0a to test it.
I have the following beneficiary categories:
JE
PME
PEP
OP
this is why I actually didn't want to limit the letters for the category building block.
but it looks like I did?
PS: sorry, I didn't explain my example:
2019JEKNIN1011
2019[year]JE[beneficiary category]K[first letter of the community]NIN[first three letters of first name]1011[start time of interview]