我有一个vbscript函数需要字符串比较,其中一个/两个字符串可能包含一个通配符.不幸的是,strcomp("string1","string.*")=0对我来说不起作用,因为它正在进行比较并将.*正则表达式通配符视为文字而不是通配符.
如何比较两个字符串,其中一个和/或两个包含通配符?
功能:
Function webtableCheck(pageName, tableProperty, rowNum, colNum, checkValue)
Dim x, y, oD, oC
x = split(tableProperty,":=")
If checkValue <> "" Then
Set oD = description.Create
oD("micclass").value = "WebTable"
oD(x(0)).value = x(1)
Set oC = pageName.childobjects(oD)
y = oC(0).getcelldata(rowNum, colNum)
msgbox(y)
If y=checkValue Then
reporter.ReportEvent micPass, "WebTable Checkpoint", "The webtable checkpoint object """ & checkValue & """ was found."
Elseif **strcomp(y,checkValue,1)** = 0 Then
reporter.ReportEvent micPass, "WebTable Checkpoint", "The webtable checkpoint object """ & checkValue & …Run Code Online (Sandbox Code Playgroud)