https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions
//身份证简单校验js正则表达式
function testCard(code) {
return /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code);
}
console.error(testCard("230604188710124111"));
var pattern=/(ab)\w+(ba)/;
console.log("abcba_".replace(pattern,"$1"));
console.log("abcba_".match(pattern));
console.log("abcba_".match(pattern)[0]);