Added verification for mobile phone numbers starting with 158 and 159.
//Remove the leading and trailing spaces of the string
String. prototype.Trim = function() {
var m = this.match(/^s*(S (s S )*)s*$/);
return (m == null) ? "" : m[1];
}
//Verify legal mobile phone number
String.prototype.isMobile = function() {
return (/^(?:13d|15[89])-? d{5}(d{3}|*{3})$/.test(this.Trim()));
}
should instance: