(value, regex)
return retVal
Returns list with items that have parts satisfying given regular
    expression

    >>> filterListValue(['users', 'admins', 'logs'], r'(users|admins)')
    ['users', 'admins']
Returns list with items that have parts satisfying given regular
    expression
Returns list with items that have parts satisfying given regular expression
def filterListValue(value, regex):
    """
    Returns list with items that have parts satisfying given regular
    expression

    >>> filterListValue(['users', 'admins', 'logs'], r'(users|admins)')
    ['users', 'admins']
    """

    if isinstance(value, list) and regex:
        retVal = filter(lambda _: re.search(regex, _, re.I), value)
    else:
        retVal = value

    return retVal
def filterListValue ( value , regex ) : if isinstance ( value , list ) and regex : retVal = filter ( lambda _ : re . search ( regex , _ , re . I ) , value ) else : retVal = value return retVal