コードコピーは次のとおりです。
classwyd_aspcodehighlight
privateregex
publicKeyWord、ObjectCommand、文字列、VBCode
publicKeyWordColor、ObjectCommandColor、StringsColor、コメント、CodeColor
privatesubclass_initialize()
setRegex = newRegexp
regex.ignorecase = true ''文字がケースに敏感であり、trueが区別されないかどうかを設定します。
regex.global = true ''はフルプロセスの性質を設定します。
keywordcolor = "#0000ff"
objectcommandcolor = "#ff0000"
stringscolor = "#ff00ff"
コメント= "#008000"
codecolor = "#993300"
keyword = "set | private | if | then | sub | end | function | for | next | do | while | wend | true | false | nothing | class" '' guan jian anselfを追加してください
objectCommand = "left | mid | right | int | clng | string | join | array" ''関数自分で追加してください
vbcode = ""
Endingub
privatesubclass_terminate()
setRegex =何もない
Endingub
privatefunctionm_replace(str、パターン、色)
regex.pattern = pattern ''セットモード。
m_replace = regex.replace(str、 "<fontcolor ="&color& "> $ 1 </font>")
エンド機能
privatefunctionstring_replace(str、pattern、pattern1、color、isstring)
dimtemp、retstr
regex.pattern = pattern1
setMatches = regex.execute(str)
foreachmatchinmatches ''マッチコレクションのトラバーサル
temp = re(match.value)
str =置換(str、match.value、temp)
次
regex.pattern = pattern ''セットモード。
ifisstring = 1then
string_replace = regex.replace(str、 "<fontcolor ="&color& ">" $ 1 "</font>")
それ以外
string_replace = regex.replace(str、 "<fontcolor ="&color& "> $ 1 </font>")
endif
エンド機能
privateFunctionre(str)
Dimtregex、温度
setTregex = newRegexp
tregex.ignorecase = true ''文字がケースに敏感かどうかを設定します。
tregex.global = true ''はフルプロセスの性質を設定します。
tregex.pattern = "<。*?>"
temp = tregex.replace(str、 "")
temp =置換(temp、 "<"、 "")
temp = cheplage(temp、 ">"、 "")
re =温度
SetTregex =何もない
エンド機能
publicFunctionMakeli()
dimtemp
ifvbcode = "" then