一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

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

时间:2010-08-29 编辑:简简单单 来源:一聚教程网

方法二

方法三

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

 

方法四

 

$str = 'http://www.111com.net/ 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);

热门栏目