<%
'str="什么是一生一世的爱，什么是今生的等待，一切都已明白，就让我们一起努力，共同创造辉煌的明天"
Function validString(str1)
	ok=""
	tempStr=str1
	validString=False
	'全角转为半角
	F0="０另令领铃铃玲灵岭龄凌陵菱伶羚酃苓岭囹泠绫柃棂瓴聆蛉翎翎鲮棱林临淋邻磷鳞赁吝拎琳霖凛蔺啉嶙廪懔遴檩辚膦瞵粼躏麟"
	F1="１一以已亿衣移依易医乙仪亦椅益倚姨翼译伊壹揖铱颐夷胰疑沂宜彝蚁矣艺抑邑役臆逸肄疫裔意毅忆义溢诣议谊异翌绎刈劓佚佾诒圯埸懿苡薏弈奕挹弋呓咦咿噫峄嶷猗饴怿怡悒漪迤驿缢殪"
	F2="２而二耳儿饵尔贰洱迩珥铒鸸鲕佴"
	F3="３三散伞叁馓毵糁霰"
	F4="４四死丝撕似私嘶思寺司斯肆嗣饲巳厮兕厶咝汜泗澌姒驷缌祀锶鸶耜蛳笥厕食伺俟俟"
	F5="５无五屋物舞雾误捂污悟勿钨武戊务呜伍吴午吾侮乌毋恶诬芜巫晤梧坞兀仵阢邬圬芴"
	F6="６六流留刘柳溜硫瘤榴榴琉馏浏遛骝绺旒熘锍镏鹨鎏碌陆"
	F7="７起其七气期齐器妻骑汽棋奇欺漆启戚柒岂砌弃泣祁崎企乞契歧祈栖畦崎稽迄缉沏讫旗亓芑芪萁萋葺蕲"
	F8="８把八吧爸拔罢跋巴芭扒坝霸叭靶笆疤疤耙捌茇菝岜灞钯粑鲅"
	F9="９就九酒旧久就揪救纠舅究韭厩臼玖灸咎疚僦啾阄柩桕鸠鹫赳鬏蹴"
	Bj=array("0","1","2","3","4","5","6","7","8","9")
	L=Len(str1)
	For i=1 To L
		If InStr(F0,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"0")
		End if
		If InStr(F1,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"1")
		End if
		If InStr(F2,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"2")
		End if
		If InStr(F3,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"3")
		End if
		If InStr(F4,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"4")
		End if
		If InStr(F5,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"5")
		End if
		If InStr(F6,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"6")
		End if
		If InStr(F7,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"7")
		End If
		If InStr(F8,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"8")
		End If
		If InStr(F9,mid(str1,i,1))>0 Then
			str1=Replace(str1,mid(str1,i,1),"9")
		End If
	Next	
	'替换-
	str1=Replace(str1,"-","")

	'替换英文数字
	str1=replace(str1,"zero","0",1,-1,1)
	str1=replace(str1,"one","1",1,-1,1)
	str1=replace(str1,"two","2",1,-1,1)
	str1=replace(str1,"three","3",1,-1,1)
	str1=replace(str1,"four","4",1,-1,1)
	str1=replace(str1,"five","5",1,-1,1)
	str1=replace(str1,"six","6",1,-1,1)
	str1=replace(str1,"seven","7",1,-1,1)
	str1=replace(str1,"eight","8",1,-1,1)
	str1=replace(str1,"nine","9",1,-1,1)
	str1=replace(str1,"ten","10",1,-1,1)
	'正则匹配1 连续的几个数字
	set cc = new RegExp
	cc.IgnoreCase = true
	cc.Global = True
	cc.IgnoreCase = True
	cc.MultiLine = True
	cc.Pattern = "\d{5}" '正则表达式
	set matches = cc.execute(str1)
	For each mach In matches
		ok=ok & ":)"
	Next
	'response.write ok
	If Len(ok)>0 Then
		validString=True
	End If
	

	'正则匹配2 间隔的几个数字
	cc.Pattern = "\D{0,2}\d{1}\D{0,2}\d{1}\D{0,2}\d{1}\D{0,2}\d{1}\D{0,2}\d{1}" '正则表达式
	set matches = cc.execute(str1)
	For each mach In matches
		ok=ok & ":)"
	Next
	'response.write ok
	If Len(ok)>0 Then
		validString=True
	End If

	'是否含邮件地址
	names = Split(str1, "@")
	if UBound(names) >= 1 Then
		s=InStr(str1,"@")
		s0=CInt(s-4)
		s1=Right(names(0),4)
		s2=Lcase(mid(str1,s+1,s+7))
		IsValidEmail = True

		for i = 1 to Len(s1)
		    c = Lcase(Mid(s1, i, 1))
			if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
		       IsValidEmail = false
		    end if
	    Next
		for i = 1 to Len(s2)
		    c = Lcase(Mid(s2, i, 1))
			if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
		       IsValidEmail = false
		    end if
	    Next
	    validString=IsValidEmail
	End if

	'匹配网址
	cc.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
	set matches = cc.execute(str1)
	For each mach In matches
		ok=ok & ":)"
	Next
	If Len(ok)>0 Then
		validString=True
	End If

	If InStr(LCase(str1),".com")>0 Or InStr(LCase(str1),".cn")>0 Or InStr(LCase(str1),".net")>0 Or InStr(LCase(str1),".com.cn")>0 Or InStr(LCase(str1),".net.cn")>0 Then
		validString=True
	End If
	str1=tempStr
End Function

'If validString(str)=True Then
'response.write("ok")
'Else
'response.write("no")
'End if
%>