I have a string:
" City: Birmingham City: St. Louis"
I want to match both city names… in this case, “Birmingham” and “St. Louis”
I figured I’d use a regex that would look for the text "City: " and retrieve what comes after that until it hits either "City: " again or the end of the line. Then I’d just trim off any extra spaces around my matches.
I have the following Regex expression that isn’t quite getting me what I want:
(?<=City: ).+((?=City: )|$)
It matches from the first city to the end of the line