code: public File getAlternateContentDirectory(String userAgent) {
      Configuration config = liveConfig;
      for(AlternateContent configuration: config.configs) {
        try {
          if(configuration.compiledPattern.matcher(userAgent).matches()) {
            return new File(config.metaDir, configuration.getContentDirectory());
          }
        } catch(Exception e) {
          logger.warn("Failed to process config: "+ configuration.getPattern()+"->"+ configuration.getContentDirectory(), e);
        }
      }
      return null;
    }
docs: Iterates through AlternateContent objects trying to match against their pre compiled pattern.
  
  @param userAgent The userAgent request header.
  @return the ContentDirectory of the matched AlternateContent instance or null if none are found.