实现前端正则匹配【{#】两个字符组合出现的个数
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>
<script>
var str="{#value#}:{#type#}{#ip#}({#deviceName#})在{#time#}发生[{#level#}]告警,告警内容是{#description#}";
var n = str.match(/{#/g).length;
document.write(n);
</script>
</body>
</html>
输出结果:7