def strip_opt(name):
    """
    strip special characters from an option definition

    >>> strip_opt("fr?ed|sc?ooby|shaggy")
    'fred'
    """
    return name.split('=', 1)[0].split('|', 1)[0].replace('?', '')
