private static String chineseCharRegEx = ".*([\u2E80-\uFFFD]).*"; // 用于检查中文及中文字符的正则表达式,实际包含了整个双字节区
public String getStrFromFile()
{
BufferedReader in = null;
StringBuffer sb = new StringBuffer();
try
{
in = new BufferedReader(new InputStreamReader(new FileInputStream(filePath)));
String tmpStr = null;
while((tmpStr = in.readLine()) != null)
{
if(!tmpStr.matches(chineseCharRegEx))
{
sb.append(tmpStr);
sb.append('\n');
}
}
in.close();
}
catch(Exception e)
{
e.printStackTrace();
logger.error("", e);
}
return sb.toString();
}