regular expression in short answer in a cloze

regular expression in short answer in a cloze

by Niv Schwarz -
Number of replies: 3

Hello,

I wrote a very simple regex as : 

\s*0\s*

(the purpose wat catching any spaces before or after the number zero)

unfortunately the regex doesn't work. The only phrase it catches is the regex it self.
be happy for any suggestion how to fix this.

thank you in advance,
niv.

Average of ratings: -
In reply to Niv Schwarz

regular expression in short answer in a cloze

by Ralf Drechsler -

 cheapessaywriter.co.uk

Shorthand character classes > Regex


Hi Niv,

You could also use the octal value \040 to match the space character. Or the hexadecimal value \x20
I also used the \b for word boundaries.
Check the answers here:
https://stackoverflow.com/questions/559363/matching-a-space-in-regex
https://www.regular-expressions.info/shorthand.html

In reply to Ralf Drechsler

תשובה ל: regular expression in short answer in a cloze

by Niv Schwarz -
Hello Ralf,
Thank you very much for your answer.
It seems like any regular expression I'm writing (except the regex *) is not being recognized by the moodle. Have no Idea why is that. Any suggestion or example for regex that works for any of you will be great.
Thank you in advanced for you all.
Niv.