javascript去除字符串中所有标点符号和提取纯文本的正则
用正则表达式除字符串中所有标点符号
<scriptlanguage="javascript">
varstr="jfkldsjalk,.23@#!$$k~! @#$%^&*()(_+-=|\{}[]';:,./<>??gg g~```gf";
str=str.replace(/[\|\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]/g,"");
alert(str);
</script>
用正则表达式提取html中文本
<scriptlanguage="javascript"> str='<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title>无标题文档</title></head><br/>'; str=str.replace(/<[^>]*>|/g,""); alert(str); </script>
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短