Wanted: Regex ideas for Gapfill

Wanted: Regex ideas for Gapfill

by Marcus Green -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I have been going over the documentation for my Gapfill question type and it occurred to me that the Regular Expression examples are quite limited. One of the examples I give is to allow UK and US spellings e.g. [color|colour], but that hardly scratches the surface of what is possible.

Would people like to suggest additional fairly simple regular expressions that could be included in the examples/appendix. It's best if you try them in the Gapfill question type to see they actually work as there is some pre-processing done before any regex are applied to the response.

You can see the current documentation of regex here

https://docs.moodle.org/36/en/Gapfill_question_type#Regular_Expressions

On a different but related note to any developers reading this, I would like to have some code in the editing form that checks for regex characters before saving and if found warns the user with a Save or Cancel box. This is to avoid the situation where people use regex characters without realising and the results don't make sense.

Average of ratings: -