… gibt dir die Stelle aus an der der gesuchte Ausdruck
gefunden wurde.
Hallo Gollum,
danke für die Info. Habe inzwischen bei Microsoft weitere Infos gefunden mit Beispiel:
Function TestRegExp(myPattern As String, myString As String)
'Create objects.
Dim objRegExp As RegExp
Dim objMatch As Match
Dim colMatches As MatchCollection
Dim RetStr As String
’ Create a regular expression object.
Set objRegExp = New RegExp
'Set the pattern by using the Pattern property.
objRegExp.Pattern = myPattern
’ Set Case Insensitivity.
objRegExp.IgnoreCase = True
'Set global applicability.
objRegExp.Global = True
'Test whether the String can be compared.
If (objRegExp.Test(myString) = True) Then
'Get the matches.
Set colMatches = objRegExp.Execute(myString) ’ Execute search.
For Each objMatch In colMatches ’ Iterate Matches collection.
RetStr = RetStr & "Match found at position "
RetStr = RetStr & objMatch.FirstIndex & „. Match Value is '“
RetStr = RetStr & objMatch.Value & „’.“ & vbCrLf
Next
Else
RetStr = „String Matching Failed“
End If
TestRegExp = RetStr
End Function