标签:抽取电话号码
/**
* 由原生电话号码字符串得到正确格式的电话号码字符串数组
* @param tel原生电话号码字符串
* @return
*/
private String[] getTelNums(String tel) {
String [] telNums=new String[]{"0"};
String regEx ="(\\(\\d{3,4}\\)|\\d{3,4}-|\\s)?\\d{7,14}";
String s="";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(tel);
while (m.find()) {
s+=m.group(0).trim()+",";
}
telNums=s.split(",");
return telNums;
}
标签:抽取电话号码
原文地址:http://2632450.blog.51cto.com/2622450/1585288