How to remove all characters between two brackets?

How to remove all characters  between two brackets?
 
Such as "12345 (rtetnj) dsfd (fddsgd) dsf "----> "12345  dsfd  dsf "
 
Use regexp syntaxes ,it's too simple .
 
Function StringWithoutBrackets(ByVal s As String) As String
With CreateObject("VBSCRIPT.REGEXP")
    .Global = True
    .Pattern = "[(][^)]*[)]"
    StringWithoutBrackets = .Replace(s, "")
End With
End Function
 

Sub test()
MsgBox StringWithoutBrackets("12345 (rtetnj) dsfd (fddsgd) dsf ")
End Sub
 

原文地址:https://www.cnblogs.com/fengju/p/6336298.html