正则表达式替换报表名称中的特殊字符

        // 表达式对象
                  Pattern p = Pattern. compile("[\\\\?\\*\\:\\[\\]\\/]");
                   // 创建 Matcher 对象
                  Matcher n = p.matcher(systemName);
                  Matcher m = p.matcher(unitCodeName);
                   // 替换
                  String sheetNameSystem = n.replaceAll( "");
                  String sheetNameUnit = m.replaceAll( "");

 

posted @ 2016-11-09 10:32  IT_小树  阅读(579)  评论(0编辑  收藏  举报