Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
You must modify your regular expressions to work, since in the current way they will not match. Your regular expressions should look like this: hi = /h(i|ello|allo)/i; wau = /Who\s(are|r)\s(you|u)\?/i; whau = /What\s(are|r)\s(you|u)/i; Edit: I had not seen all your code, since I saw it I thought that this would be more appropriate for the way you are working your RegExp: hi = /h(i|ello|allo)/i; wau = /[who(are|r)(you|u)\?]/i; whau = /[what(are|r)(you|u)\?]/i;
15th Jul 2018, 11:43 AM
Mickel
Mickel - avatar
+ 4
I removed spaces in the regex expressions and it matched my input (without spaces, ofc). Perhaps there is a different way of expressing whitspaces there? Can't tweak around much ATM, but the problem is surely with the expression itself.
15th Jul 2018, 11:45 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
Did you try with the RegExp that I put later? They work for me https://code.sololearn.com/W9AA93Fm2DZK
15th Jul 2018, 6:07 PM
Mickel
Mickel - avatar