此类高亮根据Editplus高亮来做的
复制代码代码如下:
ClassWyd_AspCodeHighLight
PrivateRegEx
PublicKeyword,ObjectCommand,Strings,VBCode
PublicKeyWordColor,ObjectCommandColor,StringsColor,Comment,CodeColor
PrivateSubClass_Initialize()
SetRegEx=NewRegExp
RegEx.IgnoreCase=True'设置是否区分字母的大小写True不区分。
RegEx.Global=True'设置全程性质。
KeyWordColor="#0000FF"
ObjectCommandColor="#FF0000"
StringsColor="#FF00FF"
Comment="#008000"
CodeColor="#993300"
Keyword="Set|Private|If|Then|Sub|End|Function|For|Next|Do|While|Wend|True|False|Nothing|Class"'关建字请自己添加
ObjectCommand="Left|Mid|Right|Int|Cint|Clng|String|Join|Array"'函数请自己添加
VBCode=""
EndSub
PrivateSubClass_Terminate()
SetRegEx=Nothing
EndSub
PrivateFunctionM_Replace(Str,Pattern,Color)
RegEx.Pattern=Pattern'设置模式。
M_Replace=RegEx.Replace(Str,"<fontcolor="&Color&">$1</font>")
EndFunction
PrivateFunctionString_Replace(Str,Pattern,Pattern1,Color,IsString)
DimTemp,RetStr
RegEx.Pattern=Pattern1
SetMatches=RegEx.Execute(Str)
ForEachMatchInMatches'遍历Matches集合
Temp=Re(Match.value)
Str=Replace(Str,Match.value,Temp)
Next
RegEx.Pattern=Pattern'设置模式。
IfIsString=1Then
String_Replace=RegEx.Replace(Str,"<fontcolor="&Color&">"$1"</font>")
Else
String_Replace=RegEx.Replace(Str,"<fontcolor="&Color&">$1</font>")
EndIf
EndFunction
PrivateFunctionRe(Str)
DimTRegEx,Temp
SetTRegEx=NewRegExp
TRegEx.IgnoreCase=True'设置是否区分字母的大小写。