import re


def extract_sid_prefix(s3_object_key):
    """
    Convert the inputted s3_object_key into a prefix for PolicyStatement.
    """
    base = s3_object_key.rstrip(".json")
    return re.sub("[\W_]", "", base)