网学网为广大网友收集整理了,asp+正则获得字符串中最后一个字母非字母不算,希望对大家有所帮助!
复制代码 代码如下:
Function getLastWord(str)
Set regEx = New RegExp
regEx.Pattern = "(.*)([a-zA-Z])[^a-zA-Z]*"
regEx.IgnoreCase = false
regEx.Global = True
str = regEx.Replace(str,"$2")
getLastWord = str
Set reg=nothing
End Function
str="1B2A3fdsafdsf32432432"
Response.Write(getLastWord(str)):Response.End()