import re


def strip_outer_parens(value):
    """Strip parentheses surrounding a string, ignoring leading and trailing
    whitespace"""
    if value is None:
        return ''
    value = value.strip()
    m = re.match(r'^\{\((.*)\)\}$', value)
    if m is not None:
        value = m.groups()[0]
    m = re.match(r'^\((.*)\)$', value)
    if m is not None:
        value = m.groups()[0]
    return value