Sub ReplaceWildcard($source As String, $searchWildcard As String, $replaceStr As String) As String


Returns a string in which a specified substring, defined by a Wildcard, is replaced with another substring. All matching occurrences are replaced.


$searchWildcard is a Wildcard that consists of a start text, an asterisk, and an end text, using the following syntax:


StartText*EndText


ReplaceWildcard is case-insensitive.


Parameters


  • $source ... String expression that contains the substring to replace.
  • $searchWildcard ... Wildcard expression to search for.
  • $replaceStr ... Substring used as the replacement.


Example:

Dim $s

$s = "<table><tr><td>354</td></tr></table>"
$s = ReplaceWildcard($s, "</td>*</td>", "</td>-</td>")
' returns $s = "<table><tr><td>-</td></tr></table>"