Jenis penyorotan ini dilakukan berdasarkan penyorotan editplus
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 case 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" fungsi tolong tambahkan sendiri
Vbcode = ""
Endsub
Privatesubclass_terminate ()
SetRegex = tidak ada
Endsub
PrivateFunctionM_replace (str, pola, warna)
Regex.pattern = Mode Set Pattern '.
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)
Koleksi Traversal of Matches ForeAchMatchInmatches '
Temp = re (match.value)
Str = ganti (str, match.value, temp)
Berikutnya
Regex.pattern = Mode Set Pattern '.
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 'menetapkan apakah huruf sensitif.