title: VBS Compare strings using wildcard
body: <p>I have a vbscript function that requires a string comparison where one/both strings may include a wildcard.  Unfortunately, <code>strcomp("string1","string.*")=0</code> does not work for me as it is doing a comparison and seeing the <code>.*</code> regex wildcard as a literal and not a wildcard.</p>
  
  <p>How do I go about comparing two strings where one and/or both include a wildcard?</p>
  
  <p>Function:</p>
  
  <pre><code>Function webtableCheck(pageName, tableProperty, rowNum, colNum, checkValue)
     Dim x, y, oD, oC
      x = split(tableProperty,":=")
     If checkValue &lt;&gt; "" 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 """ &amp;  checkValue &amp; """ was found."
          Elseif  **strcomp(y,checkValue,1)** = 0 Then
              reporter.ReportEvent micPass, "WebTable Checkpoint", "The webtable checkpoint object """ &amp;  checkValue &amp; """ was found, however the casing does not match."
          Elseif strcomp(trim(y),trim(checkValue)) = 0 Then
              reporter.ReportEvent micPass, "WebTable Checkpoint", "The webtable checkpoint object """ &amp;  checkValue &amp; """ was found, however leading/lagging spaces not included in datatable and/or webtable cell was found."
          Elseif instr(1,y,checkValue,1) Then
              reporter.ReportEvent micPass, "WebTable Checkpoint", "The webtable checkpoint object """ &amp;  checkValue &amp; """ was found., however a line break or other hidden character was found in the webtable."
          Else
              reporter.ReportEvent micFail, "WebTable Checkpoint", "The webtable checkpoint object """ &amp;  checkValue &amp; """ was not found."
          End If
      End If
  End Function
  </code></pre>