i am very new to regex world. what i have is a text file which i would like to find a specific word before a specific string (in this case 'out') in it and store into a variable. so i can replace it with something else later in the code. below i will put < > around the interesting words i am looking for just for the highlighting purpose. it would be awesome if someone can point me to the right direction. the text file that i have is as below: in this case i would like to find the words that are highlighted with < >. i apologize in advance if my question is not as clear as i have difficulty describing what i am looking for.
neighbor 10.242.1.1 route-map LOCAL_PREF in
neighbor 10.242.1.1 route-map <grn200_NWK> out
neighbor 10.244.206.2 route-map LOCAL_PREF in
neighbor 10.244.206.2 route-map <blu330_NWK> out
neighbor 10.242.120.202 route-map LOCAL_PREF in
neighbor 10.242.120.202 route-map <grn200_NWK> out
.
.
.
the text file continues in this pattern