I have 2 string arrays, one is a list of words and the other a list of abbreviations for those words. Is there a way using REGEX that I can replace any of the words from list one that are found in the string, with the appropriate abbreviation from list two?
Const DirectionalNames As String = "(North|East|South|West|Northeast|Southeast|Northwest|Southwest)"
Const DirectionalStandards As String = "(N|E|S|W|NE|SE|NW|SW)"
MySample as string = "Go North, then take the Southeast highway for 5 miles."
Want to change it to: "Go N, then take the SE highway for 5 miles."
Thanks in Advance.
Tried various forms of replace using REGEX but couldn't find anything that worked.