I think you could get away with not even checking for parens, if you go with the idea that people doing it properly won't try to cheat it (because they'll learn nothing).
For people who do want to 'cheat', the grade is meaningless anyway.
For people who do want to 'cheat', the grade is meaningless anyway.
I guess I'm trying to view it from the POV of a beginner, as most CS people/programmers can work through this without needing the website.