var str = '82386012'; var partten = /(^(0d{2})-(d{8})$)|(^(0d{3})-(d{7})$)|(^(0d{2})-(d{8})-(d+)$)|(^(0d{3})-(d{7})-(d+)$)|(^d{7}$)|(^d{8}$)/; if(partten.test(str)){ return true; }else{ return false; }
var str = '82386012'; var partten = /(^(0d{2})-(d{8})$)|(^(0d{3})-(d{7})$)|(^(0d{2})-(d{8})-(d+)$)|(^(0d{3})-(d{7})-(d+)$)|(^d{7}$)|(^d{8}$)/; if(partten.test(str)){ return true; }else{ return false; }