question: static private String munge ( final String s ) { return s . replaceAll ( "[\\W]" , "_" ) ; }
target:  Munge a name index so that it is suitable for use in a filesystem. In particular, any non-word characters are converted to an underscore character ("_"). This gets rid of all punctuation characters and whitespace in the index name itself, but will not translate unicode characters.