question: private String formatMessagePlaceHolders ( String message ) { int occurances = 0 ; while ( message . matches ( ".*\\{[a-zA-Z]+\\}.*" ) ) { message = message . replaceFirst ( "\\{[a-zA-Z]+\\}" , "{" + occurances + "}" ) ; occurances ++ ; } return message ; }
target:  Formats message placeholders to Java format, eg {maxlength} to {0}