VBA RegEx getting String with only Number and Hyphen
excel, regex, vba
Solution
you can use this pattern in a replace expression:
reg.Pattern = "[^\d-]+"
Debug.Print reg.Replace(yourstring, "")
Problem
I have a string with something like `Bl. 01 - 03` I want this to be reduced to only `01-03` Everything other than digits & hyphen should be removed. Any ideas how to do it using regex or any other method?