diff --git a/apis/s3/src/main/java/org/jclouds/s3/filters/AwsHostNameUtils.java b/apis/s3/src/main/java/org/jclouds/s3/filters/AwsHostNameUtils.java index e133aa3ade..fa12998a5c 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/filters/AwsHostNameUtils.java +++ b/apis/s3/src/main/java/org/jclouds/s3/filters/AwsHostNameUtils.java @@ -26,7 +26,7 @@ public class AwsHostNameUtils { - private static final Pattern S3_ENDPOINT_PATTERN = Pattern.compile("^(?:.+\\.)?s3[.-]([a-z0-9-]+)$"); + private static final Pattern S3_ENDPOINT_PATTERN = Pattern.compile("^(?:.+\\.)?s3[.\\-]([a-z0-9-]+)(?>\\.[a-z0-9-]+)*$"); private static final Pattern STANDARD_CLOUDSEARCH_ENDPOINT_PATTERN = Pattern.compile("^(?:.+\\.)?([a-z0-9-]+)\\.cloudsearch$"); @@ -107,7 +107,7 @@ private static String parseStandardRegionName(final String fragment) { Matcher matcher = S3_ENDPOINT_PATTERN.matcher(fragment); if (matcher.matches()) { - // host was 'bucket.s3-[region].amazonaws.com'. + // host was '[whatever].s3[.|-]-[region].[whatever].amazonaws.com return matcher.group(1); }