يتم هذا النوع من التمييز بناءً على تسليط الضوء على تعديله
نسخة الكود كما يلي:
classwyd_aspcodehighlight
الخصوصية
PublicKeyword ، ObjectCommand ، سلاسل ، vbcode
PublicKeywordColor ، ObjectCommandColor ، StringsColor ، تعليق ، رمز برمجية
privatesubclass_initialize ()
setRegex = NewRegexp
regex.ignorecase = set 'set ما إذا كانت الحروف حساسة للحالة ، ولا يتم تمييزها.
regex.global = true 'يعين الطبيعة العملية الكاملة.
KeywordColor = "#0000FF"
ObjectCommandColor = "#ff0000"
StringsColor = "#ff00ff"
التعليق = "#008000"
codecolor = "#993300"
الكلمة الرئيسية = "SET | private | if | then | sub | end | function | for | next | the | when | wend | true | false | nothing | '' الرجاء إضافة جوان جيان بنفسك
ObjectCommand = "اليسار | منتصف | يمين | int | cint | clng | string | join | array"
vbcode = ""
ينتهي
privatesubclass_terminate ()
setRegex = لا شيء
ينتهي
privatefunctionm_replace (Str ، نمط ، لون)
regex.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 'اجتياز مجموعة Matches
temp = re (match.value)
str = استبدال (str ، match.value ، temp)
التالي
regex.pattern = نمط "وضع" وضع.
ifisstring = 1th
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 'يفسر ما إذا كانت الحروف حساسة للحالة.