import re


def is_number(num_str):
    """
    Determine whether the string can be converted to a number (int and float)
    :param num_str:
    :return:
    """
    if not re.compile(r"^[-+]?[-0-9]\d*\.\d*|[-+]?\.?[0-9]\d*$").match(num_str):
        return False
    return True