GetAllWildcardMatches

Top  Previous  Next

function GetAllWildcardMatches(sSource, sFindWildcard) As String

 

Searches in sSource for all occurrences of sFindWildcard. sFindWildcard is a Wildcard with a start text, an asterisk and an end text with the syntax:

 

StartText*EndText

 

GetAllWildcardMatches is case-sensitive. Each match is listed in a new line, separated with a carriage-return/line-feed. If sFindWildcard is not found, GetAllWildcardMatches returns an empty string.

 

Parameters

 

sSource ... String expression sought.
sFindWildcard ... Wildcard expression being searched (StartText*EndText).

 

Example:

Dim s, s2

 

= "a number or a text or a date"

s2 = GetAllWildcardMatches(s, "or*t")

' returns s2 = "or a t"#13#10"or a dat"

 

The extracted lines can be sorted with the function SortStringLines.




Translate document: