以下是ASP的代码,请问PHP下相应代码该怎样写? 
dim objRegExp
Set objRegExp=new RegExp
objRegExp.IgnoreCase =true
objRegExp.Global=True objRegExp.Pattern="(javascript)"
strContent=objRegExp.Replace(strContent,"&#106avascript") objRegExp.Pattern="(jscript:)"
strContent=objRegExp.Replace(strContent,"&#106script:") objRegExp.Pattern="(js:)"
strContent=objRegExp.Replace(strContent,"&#106s:") objRegExp.Pattern="(value)"
strContent=objRegExp.Replace(strContent,"&#118alue") objRegExp.Pattern="(about:)"
strContent=objRegExp.Replace(strContent,"about&#58") objRegExp.Pattern="(file:)"
strContent=objRegExp.Replace(strContent,"file&#58") objRegExp.Pattern="(document.cookie)"
strContent=objRegExp.Replace(strContent,"documents&#46cookie") objRegExp.Pattern="(vbscript:)"
strContent=objRegExp.Replace(strContent,"&#118bscript:") objRegExp.Pattern="(vbs:)"
strContent=objRegExp.Replace(strContent,"&#118bs:") objRegExp.Pattern="(on(mouse|exit|error|click|key))"
strContent=objRegExp.Replace(strContent,"&#111n$2") objRegExp.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
strContent = objRegExp.Replace(strContent,"<a href=""$1"" target=""_blank"">$1</a>") objRegExp.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)$([^\[]*)"
strContent = objRegExp.Replace(strContent,"<a href=""$1"" target=""_blank"">$1</a>") objRegExp.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)"
strContent = objRegExp.Replace(strContent,"<a href=""$2"" target=""_blank"">$2</a>") objRegExp.Pattern = "(^[(http://|http:\\)])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*)*)"
strContent = objRegExp.Replace(strContent,"<a href=""http://$2"" target=""_blank"">$2</a>")

解决方案 »

  1.   

    应该自己学习,
    而不是在这里来找 免费代码转换器....preg_replace  PHP 的正则替换..
      

  2.   

    preg_replace  看看手册基本就可以写了,你的正则是现成的,按照参数顺序放到函数里就可以了。
      

  3.   

    preg_replace,直接替换正则
    但PHP的正则和vBscript的正则是有不同的,但多数相同
    PHP的正则有两 种,preg_replace是兼容pear的,查手册
      

  4.   

    我想要的结果就是把这些代码转成PHP的