SoFunction
Updated on 2025-02-28

js supports verification of mobile phone numbers starting from 158 and 159


//Remove the beginning and end spaces of the string
 = function() { 
  var m = (/^\s*(\S+(\s+\S+)*)\s*$/); 
  return (m == null) ? "" : m[1]; 

//Verify the legal mobile phone number
 = function() { 
  return (/^(?:13\d|15[89])-?\d{5}(\d{3}|\*{3})$/.test(()));