I am using the following UDF to remove all special characters
Function RemoveSpecialCharacters(s As String)
With CreateObject("vbscript.regexp")
.Pattern = "[^A-Z0-9_\- /&]"
.IgnoreCase = True
.Global = True
RemoveSpecialCharacters = .Replace(s, "")
End With
End Function
But I would like to NOT remove _ - \ / and &
The function works, but it also removes the \
What is the 'trick' to be able to also include the \ in the exclusion list?
Function RemoveSpecialCharacters(s As String)
With CreateObject("vbscript.regexp")
.Pattern = "[^A-Z0-9_\- /&]"
.IgnoreCase = True
.Global = True
RemoveSpecialCharacters = .Replace(s, "")
End With
End Function
But I would like to NOT remove _ - \ / and &
The function works, but it also removes the \
What is the 'trick' to be able to also include the \ in the exclusion list?