字符串"[url=http://123.com]123.com[/url]"如何转变成

gdsean 2002-06-03 10:00:35
字符串"123.com"如何转变成
<a href=http://123.com>123.com</a>
...全文
156 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
gdsean 2002-06-03
  • 打赏
  • 举报
回复
help?
gdsean 2002-06-03
  • 打赏
  • 举报
回复
老兄有没有处理vB代码的函数?
比如[image]http://.../1.gif[/image]
www.vbulletin.com/forum/
点这里访问紫桐社区
myname@domain.com
点这里给我写信
等等
变成html代码
加分!
gdsean 2002-06-03
  • 打赏
  • 举报
回复
使用表达式?!
有没有简单点的?
使用字符串处理函数
ChinaOk 2002-06-03
  • 打赏
  • 举报
回复
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\[URL\])(http:\/\/.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""http://$2"" TARGET=_blank>$2</A>")

re.Pattern="(\[URL=(http:\/\/.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$3</A>")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""http://$2"" TARGET=_blank>$3</A>")

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧