This is my collection of validation patterns for XLSForm, mainly used in Kobo. To use in Kobo, click the cog at the question, go to validation criteria, click to manually enter validation logic in XLSForm code and paste the pattern. Contributions welcome!
regex(., '\+?\d+$')
Allows any length numeric, no-spaces phone number, possibly starting with "+" for country code.
regex(., '^(0[1-9]|[12][0-9]|3[01])(0[1-9]|1[0-2])(\d{2})([-+yxwvuabcdefYXWVUABCDEF])(\d{3})([0123456789abcdefhjklmnprstuvwxyABCDEFHJKLMNPRSTUVWXY])$')
Allows any Finnish personal identity code according to the 2023 code reform.
The groupings are necessary for the pattern to validate correctly, but could likely be non-capturing groups as the result can't be used in Kobo anywhere. I haven't tried.