I have an application where grammar school teachers can place an answer box on a page after a question. The answer box is configured by the teacher with an answer line that specifies acceptable answers to the question. I don't expect them to give me a valid regular expression for the answer so I let them write the answer in a simplified form, where a '*' represents 0 or more of anything and ',' separates multiple acceptable answers. So an answer line that contained
*cup,glass
would accept 'teacup' , 'coffee cup' , 'cup' or 'glass' but not 'cup holder'.
Is there a way I can map the answer line they provide to a single regex that I can compare the student's answer with to give me a true or false answer, i.e., it's an acceptable answer to the question, or it isn't?
Thanks