import re


def split_bucket(s3_key):
    """
    Returns the bucket name and the key from an s3 location string.
    """
    match = re.match(r'(?:s3://)?([^/]+)/(.*)', s3_key, re.IGNORECASE)

    if not match:
        return None, s3_key

    return match.group(1), match.group(2)