javascript
<pre>
function checkPhone(phone){
if (!(/^1[3|4|5|7|8]\d{9}$/.test(phone))) {
return false
}
return true
}
</pre>
Java
<pre>
public static boolean checkPhone(String phone){
Pattern p= Pattern.compile("^[1][3,4,5,7,8][0-9]{9}$");
Matcher m = p.matcher(phone);
return m.matches();
}
</pre>