教程集 www.jiaochengji.com
教程集 >  脚本编程  >  Asp.net  >  正文 asp 去除字符串中的空格和数字正则表达式

asp 去除字符串中的空格和数字正则表达式

发布时间:2016-09-26   编辑:jiaochengji.com
教程集为您提供asp 去除字符串中的空格和数字正则表达式等资源,欢迎您收藏本站,我们将为您提供最新的asp 去除字符串中的空格和数字正则表达式资源
本文章为你提供一款超好的asp 去除字符串中的空格和数字正则表达式哦,这四款替换空格与数字的正则是各有不同哦。
<blockquote><script language="网页特效" type="text/javascript">
var str;
str="10    3333    abc123";
var rg;
rg=/[0-9]{1,}|s/ig;
var newstr=str.replace(rg, "");
document.write(newstr);
</script></blockquote>

方法二

<blockquote><script language="javascript" type="text/javascript">
var str;
str="10    3333    abc123";
var rg;
rg=/[0-9]{1,}|s/ig;
var newstr=str.replace(rg, "");
document.write(newstr);
</script></blockquote>

方法三

<blockquote>function checkexp(patrn, strng)

dim regex, match   ’ 建立变量。

set regex = new regexp ’ 建立正则表达式。

regex.pattern = patrn ’ 设置模式。

regex.ignorecase = true ’ 设置是否区分字符大小写。

regex.global = true ’ 设置全局可用性。

matches = regex.test(strng)     ’ 执行搜索。

checkexp = matches

end function </blockquote>

 

方法四

 

<blockquote>

$str = 'http://www.jiaochengji.com/ http://www.aa.com/a.jpg';
//$part = '|(http://[a-za-z0-9/?&.]*)|si';
$part2 = '|(http[s]?://)?s*w.(?!(jpg|gif|png))w*|si';
preg_match_all($part2,$str,$str);
var_dump($str);

</blockquote>

您可能感兴趣的文章:
asp 去除字符串中的空格和数字正则表达式
js去掉字符串的空格或换行符(附相关正则介绍)
php怎么去除空白字符
正则表达式 模式匹配 Javascript
ASP中字符与数字操作函数总结
正则表达式在网络编程中的运用
常用正则表达式的例子
正则表达式使用详解
常用正则表达式全集
php array数组的相关处理函数and str字符串处理与正则表达式

[关闭]
~ ~