public static Partition findPartition(String regionName) {
        if (regionName == null) {
            return null;
        }

        // Known region
        Partition matchedPartition = REGION_MAP.get(regionName);
        if (matchedPartition != null) {
            return matchedPartition;
        }

        // Try matching on region name pattern
        for (Partition partition : PARTITIONS) {
            if (partition.getCompiledRegionRegex().matcher(regionName).matches()) {
                return partition;
            }
        }

        // Default to the `aws` partition if present, or null if not.
        return AWS_PARTITION;
    }
Attempts to find the partition a region is in or likely in.

@param regionName Name of the region to match against.
@return the matched partition, or null if none was found.
smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/language/functions/AwsPartition.java