
Function RegExpReplace(selectString As String) As String
Dim objRegExp As Object
Set objRegExp = CreateObject("vbscript.regexp")
With objRegExp
.Global = True
.IgnoreCase = True
If Len(selectString) = 1 Then
.Pattern = ""
Else
.Pattern = "(S|F)$"
End If
RegExpReplace = .Replace(selectString, "")
End With
End Function
|
