asp正则表达式判断是否是数字
'判断是否是数字(包括整数和浮点数)
function IsNumber(str)
if RegPatrn("^-?[1-9]\d*$",str) or RegPatrn("^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$",str) then
IsNumber=true
else
IsNumber=false
end if
end function
'正则表达式判断是否匹配
Function RegPatrn(patrn, strng)
RegPatrn = false
Dim regEx, Match, Matches '建立变量。
Set regEx = New RegExp '建立正则表达式。
regEx.Pattern = patrn'设置模式。
regEx.IgnoreCase = True '设置是否区分字符大小写。
regEx.Global = True '设置全局可用性。
If regEx.Test(strng) Then
RegPatrn=true
End if
End Function
相关文档:
如id="a/b/c/asdf.html" 参数为动态
怎么把后面的asdf.html过滤?使id="a/b/c/"?
如果id的格式一定为 "????/????/??????/xxxx.xxx"
即最后所要过滤掉的一定是最后一个"/"之后的内容
可以用如下方法:
<%
URL="a/b/c/asdf.html"
PartOfURL=split(URL,"/") '将字符串以"/"分割
UnNeed=spli ......
编者注:这个class主要用于操作asp中的xmlhttp。
首先是类定义 Cls_AspHttp.asp:
<%
''=================================================================
''飞扬远程获取类(AspHttp) 1.0.1 Bate1
'' By 奔腾的心
'' 2006-04-19
''=========================================================== ......
Dim xmlDoc
NewsConfigFile=server.MapPath("/test.xml")
Set xmlDoc=Server.CreateObject("msxml2.FreeThreadedDOMDocument.3.0")
If Not xmlDoc.load(NewsConfigFile) Then
'XmlDoc.loadxml "<?xml version=""1.0"" encoding=""gb2312""?><NewscodeInfo/>"
response.Write("不存在数据")
& ......
<%
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
Private m_lOnBits(30)
Private m_l2Power(30)
Private Function LShift(lValue, iShiftBits)
If iShiftBits = 0 Then
LShift = lValue
Exit Function
ElseIf iShiftBi ......