Having multiple answers to a question, is it possible to check, using a regex and JavaScript, if part of a given answer is correct?
For example the english phrase "I think about it" can be translated into Esperanto as "Mi pensas pri tio" or "Mi pensas al tio". While the user is writing his answer, the input text should turn red, if there is any error. So for example the input "Mi pensas" is correct.
Instead of looping through all possible answers, is it possible to use a pattern like "Mi pensas (pri|al) tio"?