//excel共有两列,其中第二列为手机号
InputStream in;
String str="error";
Workbook book;
try {book = Workbook.getWorkbook(in);
Sheet sheet = book.getSheet(0);
for(int i=0; i<sheet.getRows(); i++){
for(int j=1; j<sheet.getColumns(); j++){
Cell cell = sheet.getCell(j,i);
String phone=cell.getContents();
if(phone.matches("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$")){
str += phone+",";
}
}
}
return str;
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "error";