hellothere4
New Member
- Joined
- May 9, 2011
- Messages
- 17
Hi, I'm using a recommended character replace regex I got from this forum, however it is not fully working in deleting unspecified characters - wondering if anyone can figure out why.
Original String:acAc10[]() _~!#$%^'&*()+-[]`"
Actual Result:acAc10()_#$%'&*()+-"
Desired Result:acAc10() _!'-"
Function ClearString1(ByVal sWord As String) As String
With CreateObject("VBScript.RegExp")
.Pattern = "[^a-zA-Z0-9'()""-._]"
.Global = True
ClearString1 = .replace(sWord, "")
End With
End Function
Original String:acAc10[]() _~!#$%^'&*()+-[]`"
Actual Result:acAc10()_#$%'&*()+-"
Desired Result:acAc10() _!'-"
Function ClearString1(ByVal sWord As String) As String
With CreateObject("VBScript.RegExp")
.Pattern = "[^a-zA-Z0-9'()""-._]"
.Global = True
ClearString1 = .replace(sWord, "")
End With
End Function