'Text or specific picture mode display news
Function Shownew (Content, NTYPE)
Shownew = ""
IF (ntype = 1) THEN
Shownew = shownew & "
" Shownew = Shownew & "" & showPic Content) & " td>" Shownew = Shownew & " TR>" Shownew = Shownew & " | " Shownew = Shownew & " "& Onlyword &" TD> "Shownew = Shownew &" TR> "Shownew = shownew &" table> "
Elseif (ntype = 2) THEN
Shownew = shownew & " " & online "&" shownew = shownew & " Tr> "Shownew = Shownew &" "Shownew = Shownew &" & ShowPic (Content) & " TD>" Shownew = ShowneW & " Tr>" Shownew = Shownew & " TABLE>"
Elseif (ntype = 3) THEN
Shownew = shownew & " "
Shownew = shownew & " " Shownew = ShowneW & "" & ShowPic (Content) & " TD>"
Shownew = ShowneW & " | " & Onlyword & " TD>" Shownew = Shownew & " TR>" Shownew = Shownew & " Table>"
Elseif (ntype = 4) THEN
Shownew = shownew & " "
Shownew = shownew & " "
Shownew = ShowneW & " " & "Shownew = Shownew &" | "& showpic (content) &" td> "
Shownew = shownew & " tr>" Shownew = shownew & " table>" else shownew = shownew & " " & Content & "< / TD> tr> table> "endiff
END FUNCTION
'Show the extracted picture Function ShowPic (strng)
ShowPic = "" imageURL = regexpexecute (strng)
ImageURLS = SPLIT (ImageURL, " ")
For i = lbound (imageurls) to (ubound (imageurls) - 1)
Showpic = showpic & (" 180) this.width = 180 '> ")
Next end function
'Extract pictures from content Function Regexpexecute (strng) Dim Regex, Match, Matches' Establishing Variables. Set regex = new regexp 'establishes regular expressions. Regex.pattern = "(SRC =) ('|" & chr (34) & "|)? (. [^' | / s |" & chr (34) & "] *) (/.) (JPG | GIF | PNG | BMP | JPEG) ('| "& chr (34) &" | / s |>) "" Setting mode. 'regex.pattern = "(SRC =) (' |" & chr (34) & "|)? (. [^ '| |" & chr (34) & "] *) (/.) (JPG | GIF | PNG | BMP | JPEG) ('| "& chr (34) &" |>)? "Setting mode. 'regex.pattern = "(s | s) (r | r) (c | c) = (' |" chr (34) ") (/ w | // | // | /.) (' | " CHR (34) " | * |>) "" Setting mode. Regex.ignoreCase = true 'Set whether you distinguish between characters. Regex.global = true 'Sets global availability. Set matches = regex.execute (strng) 'Executes your search. FOR Each Match In Matches' traverses matching collection. values = values & Match.SubMatches (2) & Match.SubMatches (3) & Match.SubMatches (4) & " " Next RegExpExecute = valuesEnd Function 'to remove the code function OnlyWord content and pictures related (strng) Set re = new RegExp Re.ignoreCase = True Re.global = True Re.pattern = "(<) (. [^ <] *) (SRC =) ('|" & chr (34) & "|)? (. [^' | / S | "& Chr (34) &"] *) (/.) (JPG | GIF | PNG | BMP | JPEG) ('| "& chr (34) &" | / s |>) (. [^>] * ) (>) "'Setting mode. ONLYWORD = Re.Replace (strng, ") set re = Nothing
END FUNCTION
转载请注明原文地址:https://www.9cbs.com/read-45401.html
| | | | |