Constraint to only accept a specified sequence ID

Hi am new to ODK and just trying to find my way around.

I would like some assistance with a constraint that will allow the user to enter an ID such as BT-01-20. So far I have managed to come up with regex(., '^[A-Z]{2}[0-9]{4}') which pretty much only accepts anything around BT0120.


I am far from proficient in regex, but try this


if you want upper or lower case at the start, use [A-Za-z]

Don't forget a constraint_message to tell the user what the entry should look like.

Hi, apologies for the late response. Let me try this and I will give you feedback thereafter

Thank you so much @ahblake this worked like a charm