WYD1520 written ASP highlight

xiaoxiao2021-03-06  58

[Original] I write ASP highlighting This class is highlighted according to Editplus do highlight of Class Wyd_AspCodeHighLightPrivate RegExPublic Keyword, ObjectCommand, Strings, VBCodePublic KeyWordColor, ObjectCommandColor, StringsColor, Comment, CodeColor Private Sub Class_Initialize () Set RegEx = New RegExpRegEx .IGNORECASE = true 'Set whether to distinguish the case of the letter TRUE does not distinguish. Regex.global = true 'Sets the full nature. KeywordColor = "# 0000F" 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 "'conftruction word Please add objectcommand =" Left | MID | Right | INT | CINT | CLNG | String | Join | Array "function Please add VBCode = "" End Sub Private Sub Class_Terminate () SET Regex = Nothing End Sub Private Function M_Replace (STR, PATTERN, Color) regex.pattern = pattern 'setting mode. M_Replace = RegEx.Replace (Str, " $ 1 ") End Function Private Function String_Replace (Str, Pattern, Pattern1, Color, IsString) Dim Temp, RetStrRegEx.Pattern = Pattern1 Set Matches = Regex.execute (STR) for Each Match in matches 'Traversing Matches Collection Temp = Re (Match.Value) Str = Replace (STR, Match.Value, Temp) NextRegex.pattern = Pattern' Setting mode.

If ISSTRING = 1 Then string_replace = regex.replace (str, " $ 1 ") End if End Function Private Function Re (STR) DIM TREGEX, TEMP SET TREGEX = New Regexp Tregex.Ignore = true 'Set whether to distinguish the case. TREGEX.GLOBAL = true 'Sets the full nature.

Tregex.pattern = "<. *?>" Temp = Tregex.Replace (STR, "") TEMP = Replace (Temp, "<", "") TEMP = Replace (Temp, ">," "" RE = Temp Set TRegEx = Nothing End Function Public Function MakeLi () Dim TempIf VBCode = "" Then MakeLi = "" Exit FunctionEnd If VBCode = HTMLEncode (VBCode) Temp = M_Replace (VBCode, "/ b (" & Keyword & ") / b", KeywordColor) Temp = m_replace ("& ObjectCommand &") Temp = string_replace (temp, "" "(. *?)" "" "" "(. *) (<. ?>) ("& Keyword & ObjectCommand &") (<. ">) (. *)" "", Stringscolor, 1) 'String Temp = String_Replace (TEMP, "((' | remote)", "'(. *) (" & Keyword & ObjectCommand & ") (<. ?>) (. *)", Comment, 0)' Note MAKELI = "" End Function Public Function RepVbCrlf (fString) RepVbCrlf = Replace (fString, CHR (10), "
") End Function Public Function HTMLEncode (fString) If IsNull (fString) Or FString = "" Then htmlencode = "" EXIT function end if fstring = replace (fstring, ">", ">") fstring = replace FString, "<", "<") 'fstring = replace (fstring, chr (32), "")' fstring = replace (fstring, chr (9), "") 'fstring = replace (FString, CHR (34 ), "" ") 'Fstring =

转载请注明原文地址:https://www.9cbs.com/read-82480.html

New Post(0)