×

Loading...

figure it out. Thank you. And thanks everyone who contributes his/her time

Set regEx = New RegExp
sVariable = "416-1@rfr4535ef34hb-653yuyue904537 73--39 hbhg324-789"
regEx.Global = True
regEx.Pattern = "^(\d+-)(.*)(-\d+)$"
Set oMatches = regEx.Execute(sVariable)
regEx.Pattern = "\D"
sNewVariable = oMatches(0).SubMatches(0) & regEx.Replace(oMatches(0).SubMatches(1), "") & Replace(oMatches(0).SubMatches(2), "-", "ext")
Report

Replies, comments and Discussions: