import re


def is_alnum(data):
    """
    Used to ensure that only 'safe' data can be used to query or create data.
    @param: String of data to be tested.
    @return: if data is only alphanumeric or '_' chars.
    >>> is_alnum("test")
    True
    >>> is_alnum("test_2")
    True
    >>> is_alnum(";")
    False
    >>> is_alnum("test 4")
    False
    """

    if re.match(r"[\w:]+$", data):
        return True
    return False