欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript去除字符串中所有標(biāo)點(diǎn)符號(hào)和提取純文本的正則

 更新時(shí)間:2014年06月07日 19:49:20   作者:  
這篇文章主要介紹了javascript去除字符串中所有標(biāo)點(diǎn)符號(hào)和提取純文本的正則,需要的朋友可以參考下

用正則表達(dá)式除字符串中所有標(biāo)點(diǎn)符號(hào)

復(fù)制代碼 代碼如下:

<script language="javascript"> 
 var str="jfkldsjalk,.23@#!$$k~!  @#$%^&*()(_+-=|\{}[]';:,./<>??gg  g~```gf";
  str=str.replace(/[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]/g,"");
     alert(str);
</script>

用正則表達(dá)式提取html中文本

復(fù)制代碼 代碼如下:

<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>無(wú)標(biāo)題文檔</title></head><br/ >';
   str=str.replace(/<[^>]*>|/g,"");
    alert(str);
</script>

相關(guān)文章

最新評(píng)論