Alright so I have been using Regex until now to take care of a little clean up in a directory file. The problem I am having now is that the code I would use replaces the whole pattern.
Function CorrectTH(r As String) As String
With CreateObject("VBScript.RegExp")
.Global = True
.IgnoreCase = False
.Pattern = "[0-9]+TH\b"
CorrectTH = .Replace(r, "th")
End With
End Function
If I come across something like
"9TH ave & Hill St"
my replace will give me back
"th ave & Hill St"
when obviously I want to keep any numbers before the th. In this instance I want to return
"9th ave & Hill St"
Any trick to just change some of the pattern?