VBScript替代PHP';s预赛
我需要重写以下PHP代码段(从提供的字符串中过滤掉任何非数字字符)VBScript替代PHP';s预赛,vbscript,Vbscript,我需要重写以下PHP代码段(从提供的字符串中过滤掉任何非数字字符) 转换为VBScript。有什么建议吗?看看这里:在这种情况下设置IgnoreCase是没有意义的,因为没有大小写数字,表达式与其他任何内容都匹配。 Function repNum(myString) Set RegularExpressionObject = New RegExp With RegularExpressionObject .Pattern = "[^0-9]" .I
转换为VBScript。有什么建议吗?看看这里:在这种情况下设置
IgnoreCase
是没有意义的,因为没有大小写数字,表达式与其他任何内容都匹配。
Function repNum(myString)
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "[^0-9]"
.IgnoreCase = True
.Global = True
End With
repNum = RegularExpressionObject.Replace(myString, "")
Set RegularExpressionObject = nothing
End Function
Function repNum(myString)
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "[^0-9]"
.IgnoreCase = True
.Global = True
End With
repNum = RegularExpressionObject.Replace(myString, "")
Set RegularExpressionObject = nothing
End Function