Here you can find the source of sanitize(String input, String prohibitedStringsRegexp)
public static String sanitize(String input, String prohibitedStringsRegexp)
//package com.java2s; //License from project: Apache License public class Main { private static final String PROHIBITED_STRINGS_REGEXP = "/|##|@|\""; private static final String REPLACEMENT_STRING = "_"; /**/*from w ww.j ava 2s. c om*/ * Sanitisation has to be used for every filename and other strings to be able to be stored correctly in the database * @param input * @return */ public static String sanitize(String input) { return sanitize(input, PROHIBITED_STRINGS_REGEXP); } public static String sanitize(String input, String prohibitedStringsRegexp) { return sanitize(input, prohibitedStringsRegexp, REPLACEMENT_STRING); } public static String sanitize(String input, String prohibitedStringsRegexp, String replacement) { String s = input.replaceAll(prohibitedStringsRegexp, REPLACEMENT_STRING); return s; } }