fixed function isVariable: character '^' was not excluded from the letters