Several simple regular (ASP, constantly updated ...)

xiaoxiao2021-03-06  40

<%

REM ## Simple regular detection does not contain illegal characters

REM ## string to be tested

Rem ## badwordList filtering strings must be |

Function ishavebadword (Str, BadwordList)

DIM STRPATTERN

StrPattern = BadwordList & " "

Dim Oregex, Omatch

SET OREGEX = New Regexp

Oregex.Ignorecase = true 'is not case sensitive

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 ## Simple regular replacement illegal characters, replaced by one *

REM ## string to be tested

Rem ## badwordList filtering strings must be |

Function ReplaceBadword (Str, BadwordList)

DIM STRPATTERN

StrPattern = BadwordList & " "

Dim Oregex, Omatch

SET OREGEX = New Regexp

Oregex.Ignorecase = true 'is not case sensitive

Oregex.global = true

Oregex.pattern = strpattern

Replacebadword = oregex.replace (STR, "*")

SET OREGEX = Nothing

END FUNCTION

Response.write ("ASP Xiao Moon Maroyuehen" & ishavebadword ("ASP Xiao Yueu Xiaoyuehen", "Xiaoyuehen | Xiao Moon Marriage") & "
")

Response.write ("ASP Xiao Yueu Xiaoyuehen" & ReplaceBadword ("ASP Xiao Moon Xiaoyueen", "xiaoyuehen | Xiao Moon Marriage") & "
")

REM ## detects whether it is, the micro-sequence of numbers. Multi-selection submission detection available for forms

REM ## string to be tested

Function matchnumlist (STR)

DIM STRPATTERN

StrPattern = "^ [0-9] {1,} (, [0-9] ) {0,} ___ fckpd___0quot;

Dim Oregex, Omatch

SET OREGEX = New Regexp

Oregex.Ignorecase = true 'is not case sensitive

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 ("6,1245,2122,456" & matchnumlist ("6,1245,2122,456") & "
") Response.write ("6, 1A45, 2122, 456" & matchnumlist (" 6, 1A45, 2122, 456 ") &"
")

Response.write (", 6, 1245, 2122, 456" & matchnumlist (", 6, 1245, 2122, 456") & "
")

Response.write ("6, 1245, 2122, 456," & matchnumlist ("6, 1245, 2122, 456,") & "
")

%>

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

New Post(0)