Working on regex for string -> polynomial.