import re


def validate_regex(regex_str):
    """
    Checks if a given string is valid regex

    :param str regex_str: a suspicios string that may or may not be valid regex
    :rtype: bool
    :return: True if valid regex was give, False in case of TypeError or re.error
    """
    # another of those super basic function where i am not sure if there isn't an easier way
    try:
        re.compile(regex_str)
        return True
    except re.error:
        return False
    except TypeError:  # for the string not being one
        return False