def unquote(s):
    """
    Strips matching single and double quotes from the start and end of the
    given string.
    """
    if len(s) > 1 and ((s[0] == '"' and s[-1] == '"') or
                       (s[0] == "'" and s[-1] == "'")):
        return s[1:-1]
    else:
        return s