1、| 选择 ( )分组
<script>
// | 选择 ()分组
var str = "你去哪里,他在..."
var reg = /你去|他在/g;
console.log(str.replace(reg,"*")) //*哪里,*...
</script>
2、var reg = /^…..$/ 严格匹配 整个字符串必须满足正则
<script>
var phone = "02788667777"
var reg = /(027)?8\d{7}/;
var reg = /^(027)?8\d{7}$/; //严格匹配
console.log(reg.test(phone))
</script>