<% REM # check whether a simple regular expression contains invalid characters REM # STR string to be detected REM # The badwordlist-filtered string must be separated by the | function ishavebadword (STR, badwordlist) dim strpattern = badwordlist & "+" dim oregex, omatch set oregex = new Regexp oregex. ignorecase = true' case-insensitive oregex. global = true oregex. pattern = strpattern set omatch = oregex. execute (STR) If omatch. count then ishavebadword = true else ishavebadword = false end if end function REM # Replace invalid characters with simple regular expressions, use a * to replace the REM # STR string to be detected REM # badwordlist to filter the string, which must be separated by a function replacebadword (STR, badwordlist) dim strpattern = badwordlist & "+" dim oregex, omatch set oregex = new Regexp oregex. ignorecase = true' case-insensitive oregex. global = true oregex. pattern = strpattern replacebadword = oregex. replace (STR, "*") set oregex = nothing end function response. write ("ASP Xiao Yue mark xiaoyuehen" & ishavebadword ("ASP Xiao Yue mark xiaoyuehen", "xiaoyuehen | Xiao Yue mark") & "<br>") response. write ("ASP Xiao Yue mark xiaoyuehen" & replacebadword ("ASP Xiao Yue mark xiaoyuehen", "xiaoyuehen | Xiao Yue mark") & "<br> ") rem # check whether it is a digital sequence separated by digits. multiple-choice submission of forms detection REM # STR string to be detected function matchnumlist (STR) dim strpattern = "^ [0-9] {1 ,}(, [0-9] +) {0,} ___ fckpd ___ 0 quot; dim oregex, omatch set oregex = new Regexp oregex. ignorecase = true' case-insensitive oregex. global = true oregex. pattern = strpattern set omatch = oregex. execute (STR) If omatch. count then matchnumlist = true else matchnumlist = false end if end function response. write ("2122,456, 2122,456" & matchnumlist (",") & "<br>") response. write ("6, 1a45, 2122,456" & matchnumlist ("6, 1a45, 2122,456") & "<br>") response. write (", 2122,456, 2122,456" & matchnumlist (",") & "<br>") response. write ("2122,456, 2122,456," & matchnumlist (",") & "<br>") %>