Implement mode pictures in regular expression .asp .asp

xiaoxiao2021-03-06  16

'Text or specific picture mode display news

Function Shownew (Content, NTYPE)

Shownew = ""

IF (ntype = 1) THEN

Shownew = shownew & "

" Shownew = Shownew & "" Shownew = Shownew & "
" & showPic Content) & "" Shownew = Shownew & "" Shownew = Shownew & "
"& Onlyword &" "Shownew = Shownew &" "Shownew = shownew &" "

Elseif (ntype = 2) THEN

Shownew = shownew & "

" & online "&" shownew = shownew & " "Shownew = Shownew &" "Shownew = Shownew &"
& ShowPic (Content) & "" Shownew = ShowneW & "" Shownew = Shownew & ""

Elseif (ntype = 3) THEN

Shownew = shownew & "

"

Shownew = shownew & "

" Shownew = ShowneW & "
" & ShowPic (Content) & ""

Shownew = ShowneW & "

" & Onlyword & "" Shownew = Shownew & "" Shownew = Shownew & ""

Elseif (ntype = 4) THEN

Shownew = shownew & "

"

Shownew = shownew & "

"

Shownew = ShowneW & "

" & "Shownew = Shownew &" "& showpic (content) &" "

Shownew = shownew & "" Shownew = shownew & "" else shownew = shownew & "

" & Content & "< / TD> "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 & (" ")

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

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.028, SQL: 9