import re


def tsqueryWrapVal(val):
    """
    Check if a value contains any special characters.  If it does, wrap it
    in parenthesis.

    :param val: value to possible wrap in parenthesis.
    :return: value that has been wrapped as needed.
    """
    if len(re.split('[&|!()]', val, 1)) > 1:
        return '(' + val + ')'
    return val