Khan/khan-exercises — pull request #44676 by petercollingridge (2013-04-15 20:19:09+00:00)
Title: Adding and subtraction rational expression 1.5

This includes a rational expression object that should make later exercises (and the older ones) easier to create.

It also has a function to generate regex to capture an expression. If you are silly enough to try to use this on an expression with ten terms then it will attempt to generate a regex to capture all 10! possible arrangements. So don't.

It might be better to create a validator that converts a user answer to a rational expression object and can then compare them term by term.