<script>
//备选字符集
/*
[0-9] \d
[a-z]
[A-Z]
[A-z]
*/
var str = "32313dhhhdgaggff";
var reg = /\d/g;
console.log(str.replace(reg,"*"))
</script>
<script>
/*
w [ 0-9a-zA-Z_]
.表示所有的字符
\s表示空格的意思
*/
var a= "hellow_worder1245WS"
console.log(a.replace(/\w/g,"*"))
console.log(a.replace(/./g,"*"))
</script>
<script>
var a = "hellow.word"
var reg = /\./;
console.log(a.replace(reg,"*"));
</script>