code: public static CmsPair<String, Map<String, String>> parseEmbeddedGalleryOptions(String configuration) {
  
          final Map<String, String> galleryOptions = Maps.newHashMap();
          String resultConfig = CmsStringUtil.substitute(
              PATTERN_EMBEDDED_GALLERY_CONFIG,
              configuration,
              new I_CmsRegexSubstitution() {
  
                  public String substituteMatch(String string, Matcher matcher) {
  
                      String galleryName = string.substring(matcher.start(1), matcher.end(1));
                      String embeddedConfig = string.substring(matcher.start(2), matcher.end(2));
                      galleryOptions.put(galleryName, embeddedConfig);
                      return galleryName;
                  }
              });
          return CmsPair.create(resultConfig, galleryOptions);
      }
docs: Parses and removes embedded gallery configuration strings.
  
  @param configuration the configuration string to parse
  
  @return a map containing both the string resulting from removing the embedded configurations, and the embedded configurations as a a map