preprocessing printf/regex strings (like ocaml)