How to use JS to hide the mobile phone number in the string
This article will explain in detail how to use JS to hide the mobile phone number in the string. Xiaobian thinks it is quite practical, so share it with you for reference. I hope you can gain something after reading this article.
var regx = /(1[3|4|5|7|8][\d]{9}|0[\d]{2,3}-[\d]{7,8}|400[-]? [\d]{3}[-]? [\d]{4})/g; var str = "13250203010"; var strresult = matchPhoneNum(str,regx);console.log(strresult);function matchPhoneNum(str,regx){var phoneNums = str.match(regx);for(var i= 0;i