don't assume S3 endpoint is specified
whitespace
fixed scope of regex variables