let strs = "哈哈哈哈哈哈哈哈哈哈哈jfkldsjalk,.23@#!$$k~! @#$%^&*()(_+-=|\{}[]';:,./<>??gg g~```gf";
strs = strs.replace(/[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]/g,"");
let recxType = /^[0-9A-Za-z\u4e00-\u9fa5]{15,}$/
if (!recxType.test(strs)) {
alert('请输入大于15位汉字、字母、数字组成的的有害短信样本')
} else {
alert(strs);
}
strs = strs.replace(/[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]/g,"");
let recxType = /^[0-9A-Za-z\u4e00-\u9fa5]{15,}$/
if (!recxType.test(strs)) {
alert('请输入大于15位汉字、字母、数字组成的的有害短信样本')
} else {
alert(strs);
}
<script language="javascript">
str='<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><br/ >';
str=str.replace(/<[^>]*>|/g,"");
alert(str);
</script>