vbs:把一段文字中指定字符颜色变成红色的正则
更新时间:2007年04月06日 00:00:00 作者:
vbs:把一段文字中指定字符颜色变成红色的正则
function c(Tstr,Word)
Dim re
Set re = new RegExp
re.IgnoreCase =True
re.Global=True
re.pattern = "("&Word&")"
c=re.replace(Tstr,"<font style='color:red;'>$1</font>")
End function
调用方法
response.write c("内容字串","要显示为红色的字")
比如
<%
function c(Tstr,Word)
Dim re
Set re = new RegExp
re.IgnoreCase =True
re.Global=True
re.pattern = "("&Word&")"
c=re.replace(Tstr,"<font style='color:red;'>$1</font>")
End function
Response.write("lamking.com","a")
%>
就把lamking.com中的a替换为红色的。
function c(Tstr,Word)
Dim re
Set re = new RegExp
re.IgnoreCase =True
re.Global=True
re.pattern = "("&Word&")"
c=re.replace(Tstr,"<font style='color:red;'>$1</font>")
End function
调用方法
response.write c("内容字串","要显示为红色的字")
比如
<%
function c(Tstr,Word)
Dim re
Set re = new RegExp
re.IgnoreCase =True
re.Global=True
re.pattern = "("&Word&")"
c=re.replace(Tstr,"<font style='color:red;'>$1</font>")
End function
Response.write("lamking.com","a")
%>
就把lamking.com中的a替换为红色的。
相关文章
正则表达式中?=、?!、?<=、?<!、?:的理解与应用举例
正则表达式就是用事先定义好的一些特定字符、及这些特定字符的组合,组成一个规则字符串,这个规则字符串表达对字符串的一种过滤逻辑,这篇文章主要给大家介绍了关于正则表达式中?=、?!、?<=、?<!、?:的理解与应用举例的相关资料,需要的朋友可以参考下2024-03-03
正则表达式:过滤<font>和</font>
正则表达式:过滤<font>和</font>...2007-04-04


最新评论