This particular JavaScript regular expression:
homework.description = (homework.input.match(/((\(((\S\s?)\)?)*)|(about( \w*)*))/i));
When applied to the text:
potato (potato)
Produces this unexpected output:
(potato),(potato),(potato),o),o,
This result is quite strange. The expected outcome should be:
(potato)
If you'd like to see the correct function of this regex, check out this link.