Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
VBScript 中是否有类似 IsNumeric() 的函数来检查字符串是否仅包含字母数字 (a-zA-Z0-9) 字符?还是只能通过正则表达式来确定?
使用 RegExps 的 ^ 功能(不在类中)搜索不在 (a-zA-Z0-9) 中的字符:
>> Set r = New RegExp >> r.Pattern = "[^a-zA-Z0-9]" >> For Each t In Array("aA0", "a.0") >> WScript.Echo t, CStr(r.Test(t)) >> Next >> aA0 False a.0 True