code: def _check_and_expand_exponential(expr, variables, data):
      
      if re.search(r'\^\^[0-9]+$', expr):
          order = re.compile(r'\^\^([0-9]+)$').findall(expr)
          order = range(1, int(*order) + 1)
          variables, data = exponential_terms(order, variables, data)
      elif re.search(r'\^[0-9]+[\-]?[0-9]*$', expr):
          order = re.compile(r'\^([0-9]+[\-]?[0-9]*)').findall(expr)
          order = _order_as_range(*order)
          variables, data = exponential_terms(order, variables, data)
      return variables, data
docs: Check if the current operation specifies exponential expansion. ^^6
      specifies all powers up to the 6th, ^5-6 the 5th and 6th powers, ^6 the
      6th only.