質問

I would I go about stripping all numbers from a string?

This code below is what I have been trying.

objRegExp.Pattern = "((?![a-zA-Z]).)+"
queryForHTML = objRegExp.Replace(queryForHTML, "")
役に立ちましたか?

解決

KISS. You want to find all sequences of one or more digits (to delete them). So the pattern is "\d+". Trying to specify what you don't want to find/delete is errorprone/clumsy/not necessary.

>> Set re = New RegExp
>> re.Pattern = "\d+"
>> re.Global = True
>> WScript.Echo re.Replace("a1b234c", "")
>>
abc
>>

他のヒント

This works in JavaScript /[0-9]/g it will find all occurrences of digits, and your replace will trim those out. /g is for global, I think vbscript has a Global property which you can set

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top