Regular Expression Generator

If you haven't already, you may want to read our previous post on this topic: Introducing Regular Expressions


Regular Expressions (Regex) is a very powerful tool for validation, search, replacing sub-strings, data comparison, cleaning up, data wrangling and scraping (especially web scraping).

And it is used in validation for collecting data in almost all available tools, even for non technical people such as Excel/Google sheets and even in Kobo.


Therefore, I have created a simple tool to generate Regular Expressions for specific validations for Kobo Forms (Python flavored).

Through this tool you may set the acceptance criteria based on:

  1. Language : English, Arabic, Eng+Ar

  2. Accepted Characters: Letters Only, Number Only, Alphanumeric

  3. Minimum number of characters

  4. Maximum number of characters

  5. If a "space" is allowed or not

All you need to do is access the sheet by clicking on the picture below, pick your preference from the drop down and grab your RegEx!



Now for your Kobo forms, all you need is to access your form, add a new question and follow the steps:

  1. Click on the settings gear in the top right of the Question box

  2. Click on Validation Criteria

  3. Click on "Manually enter your validation logic in XLSForm code"

  4. Paste the RegEx generated in the sheet in : Validation Code


Enjoy RegExing,

And let me know what you think.




#programming #regex #tech #coding #kobo #regularexpression #validation #technology #geek