Salinan kode adalah sebagai berikut:
Classwyd_aspcodehighlight
PrivateRegex
PublicKeyword, ObjectCommand, Strings, VBCode
PublicKeyWordColor, ObjectCommandColor, Stringscolor, Komentar, Codecolor
Privatesubclass_initialize ()
SetRegex = newregexp
Regex.ignorecase = true '' Set apakah huruf sensitif dan true tidak dibedakan.
Regex.global = true '' menetapkan sifat proses penuh.
KeyWordColor = "#0000ff"
ObjectCommandColor = "#FF0000"
Stringscolor = "#ff00ff"
Komentar = "#008000"
Codecolor = "#993300"
Kata kunci = "set | private | if | lalu | sub | end | function | for | next | do | while | wend | true | false | nothing | class" '' tolong tambahkan guan jian sendiri
ObjectCommand = "Left | mid | kanan | int | cint | clng | string | goint | array" '' function tolong tambahkan sendiri
Vbcode = ""
Endsub
Privatesubclass_terminate ()
SetRegex = tidak ada
Endsub
PrivateFunctionM_replace (str, pola, warna)
Regex.pattern = pola '' atur mode.
M_replace = regex.replace (str, "<fontcolor =" & color & "> $ 1 </font>")
Fungsi endfungsi
PrivateFunctionstring_replace (struct, pola, pola1, warna, isstring)
Dimtemp, retstr
Regex.pattern = pola1
SetMatches = regex.execute (str)
ForeachMatchInmatches '' Traversal of the Matches Collection
Temp = re (match.value)
Str = ganti (str, match.value, temp)
Berikutnya
Regex.pattern = pola '' atur mode.
Ifisstring = 1then
String_replace = regex.replace (str, "<fontcolor =" & color & ">" $ 1 "</font>")
Kalau tidak
String_replace = regex.replace (str, "<fontcolor =" & color & "> $ 1 </font>")
Endif
Fungsi endfungsi
PrivateFunctionre (str)
DiMTregex, Temp
SetTregex = newregexp
Tregex.ignorecase = true '' atur apakah huruf sensitif.
Tregex.global = true '' menetapkan sifat proses penuh.
Tregex.pattern = "<.*?>"
Temp = tregex.replace (str, "")
Temp = ganti (temp, "<", "")
Temp = ganti (temp, ">", "")
Re = temp
SetTregex = tidak ada
Fungsi endfungsi
PublicFunctionMakeli ()
Dimtemp
Ifvbcode = "" lalu