[导入]ASP常用函数:IsAlpha()

<%
'功能:返回 Boolean 值指明表达式的值是否为字母。
'来源:http://jorkin.reallydo.com/article.asp?id=525

Private Function IsAlpha(byVal sString)
    
Dim regExp, oMatch, i, sStr
    For i = 1 To Len( sString )
        
sStr = Mid(sString, i, 1)
        
Set regExp = New RegExp
        regExp.Global = True
        
regExp.IgnoreCase = True
        
regExp.Pattern = "[A-Z]|[a-z]|\s|[_]"
        
Set oMatch = regExp.Execute(sStr)
        
If oMatch.Count = 0 Then
            
IsAlpha = False
            Exit Function
        End If
        Set
regExp = Nothing
    Next
    
IsAlpha = True
End Function
%>


文章来源: http://Jorkin.Reallydo.Com/default.asp?id=525

你可能感兴趣的:(Alpha)