Function simpleCellRegex(quelle As String) As String
Dim regEx As New RegExp
Dim strPattern As String
Dim strInput As String
Dim strReplace As String
Dim strOutput As String
Dim Zwischen As String
strPattern = "\s+[A-Z]+.xls$"
If strPattern <> "" Then
strInput = quelle
strReplace = ""
With regEx
.Global = True
.MultiLine = True
.IgnoreCase = False
.Pattern = strPattern
End With
If regEx.test(strInput) Then
Zwischen = regEx.Replace(strInput, strReplace)
simpleCellRegex = Trim(Replace(Replace(strInput, Zwischen, ""), ".xls", ""))
Else
simpleCellRegex = ""
End If
End If
End Function