Hello everyone,
I have a string that has two substrings in parentheses. The string also contains a state abbreviation and zip code outside of the parentheses and another inside one of the parentheses. It looks like this:
myString = "Some words here, then (the quick brown fox) Los Angeles, CA 90071, and followed by (his other residence Chicago, IL 60604 right here)"
In strings such as this I want to remove the parenthesis that contains the state abbreviation and zip code and keep only the zip code. The result should be
myNewString = "Some words here, then (the quick brown fox) Los Angeles, CA 90071, and followed by Chicago, IL 60604"
I have a list of state abbreviations and have used Repeated[DigitCharacter,{5}] for the zip code, but my attempts with StringReplace, using Shortest and Overlaps in various combinations, do not give me what I want because the state abbreviation and zip code outside the parenthesis, CA 90071, keeps messing things up. Any tips?
Gregory