class SnakeCase {

  public static String format(String input) {
    String subbed = new StringBuilder(input).reverse().toString().replaceAll("[^\\w]|_", " ");
    String reversedResult = Arrays.stream(REV_WORD_BOUND_PAT.split(subbed)) //
        .map(String::trim) //
        .map(String::toLowerCase) //
        .filter(s -> s.length() > 0) //
        .collect(Collectors.joining("_"));
    return new StringBuilder(reversedResult).reverse().toString();
  }

  private  SnakeCase();

}