I'm not quite understanding how to remove characters from a string with RegEx.
I want to remove the "#" sign and the Comma leaving the numeric value in between.
Sample strings:
#1,1d6 5.720 Basic
End result = 1
#21,1e7 5.610
End result = 21
#23.1,1e7 TP_Ø.028_A_B_C
End result = 23.1
#113-J1-1,2c3 TP_.014_J_A^Y
End result = 113-J1-1
Any assistance is appreciated.Function RicM(ByVal txt As String) As String Static RegX As Object If RegX Is Nothing Then Set RegX = CreateObject("VBScript.RegExp") With RegX .Pattern = "#\d-\d+," 'Remove "#" and all chars after the "comma". RicM = .Replace(txt, "") End With End Function
Bookmarks