@staticmethod
def _get_number(expr):
    """Extracts numbers (integers and floats) of arbitrary length from the overall string representation."""
    for idx, digit in enumerate(expr):
        if not digit.isnumeric() and digit is not '.':
            if digit.isalpha():
                raise ValueError('invalid expression')
            return idx, expr[:idx]
    return expr
