1

我需要重写以下 PHP 片段(从提供的字符串中过滤掉任何非数字字符);

$new_string = preg_replace("/[^0-9]/", "", $old_string)

进入 VBScript。有什么建议么 ?

4

1 回答 1

3
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
于 2013-06-20T23:43:53.830 回答