<script>
function check() {
var str = saystemp.value;
var re = /(?=操作|草|靠近|中华人民共和国|法规)/;
var rtn = str.match(re);
if (rtn != null)
alert('非法字符!');
}
</script>
<input type="text" name="saystemp" value="">
<input type="button" onclick="check()" value="提交">
function check() {
var str = saystemp.value;
var re = /(?=操作|草|靠近|中华人民共和国|法规)/;
var rtn = str.match(re);
if (rtn != null)
alert('非法字符!');
}
</script>
<input type="text" name="saystemp" value="">
<input type="button" onclick="check()" value="提交">
-------------
... ...
var re = /(?=<%=r_badword%>)/;
... ...