SOURCE

function check_mail(str) {
  const re = /(\w+)@(\w+)*(\w+)/;
  return re.test(str);
}

console.log(check_mail('luck@aliyun.com'));


function check_number(str) {
  const re = /1\d{10}/;
  return re.test(str);
}


console.log(check_number('18100140124'));

console 命令行工具 X clear

                    
>
console