class RegexUtils {

    public static String normalizeFormName(String formName, boolean returnNullIfNothingChanged) {
        if (formName == null) {
            return null;
        }

        Matcher matcher = CONTROL_CHAR_PATTERN.matcher(formName);
        return matcher.find()
                ? matcher.replaceAll(" ")
                : (returnNullIfNothingChanged ? null : formName);
    }

    private  RegexUtils();

}