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 に答える