String path="D://words.properties";
InputStream in = new FileInputStream(path); // xml 的路径
InputStreamReader is = new InputStreamReader(in,"UTF-8");
//将字节流转换成字符流,同时设置编码格式
Properties pro = new Properties();
pro.load(in);
Enumeration enu = pro.propertyNames();
patternBuf.append("(");
while(enu.hasMoreElements())
{
patternBuf.append((String)enu.nextElement()+"|");
}
patternBuf.deleteCharAt(patternBuf.length()-1);
patternBuf.append(")");
System.out.println("Enumeration"+patternBuf.toString());