private static String parseProfileName(String trimmedLine) {
        if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) {
            String profileName = trimmedLine.substring(1, trimmedLine.length() - 1);
            return profileName.trim();
        }
        return null;
    }
Returns the profile name if this line indicates the beginning of a new
profile section. Otherwise, returns null.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/internal/AbstractProfilesConfigFileScanner.java