class IpTranslatorProcessor {

    protected String getEnvironmentFromSlackMessage(SlackMessage message) {
        Pattern envName = Pattern.compile(".*Environment: (?<env>.*?)\\n");
        Matcher envMatcher = envName.matcher(message.getText());
        if (! envMatcher.find()) {
            log.info("Failed to determine environment from slack message, aborting...");
            throw new RuntimeException("Failed to determine environment!");
        }
        return envMatcher.group("env");
    }

}