去掉所有非1到9或者字母的其它字符
private static String dealWithVersion(String versionArg) { String regex = "[^1-9a-zA-Z]"; versionArg = versionArg.replaceAll(regex, ""); return versionArg; }
正则表达式记录
原文:http://www.cnblogs.com/BlogCommunicator/p/7735561.html