Hello Everyone,
I almost have this working. I'm trying to find those street number suffixes that should be appearing like this 5th Avenue but are appearing with the first letter capitalized like this: 5Th
I'm using this snippet of regular expression which is working:
FIXNUMBERSUFFIX = strLookIn
objRegEx.Pattern = "\b([0-9])(Th)\b"
FIXNUMBERSUFFIX = objRegEx.Replace(FIXNUMBERSUFFIX, "$1" & "th")
It's correctly finding and changing this address 520 W. 5Th Street, Apt. 500 to this: 520 W. 5th Street, Apt. 500
Then is I realized I have to account for up to three digit street numbers. I tried the following, but it's not working. I must not have the correct expression for finding a three digit pattern. Also don't know how to reference back to it.
objRegEx.Pattern = "\b([1-9][1-9][0-9])(Th)\b"
FIXNUMBERSUFFIX = objRegEx.Replace(FIXNUMBERSUFFIX, "$1$2$3" & "th")
Thank you for your help!
Bookmarks