I want to search and replace a pattern but only if it occurs between two other patterns. How can this be achieved?
I have multiple occurances of the pattern which I want to replace in the string but I want to replace only one instance which occurs between two other patters.
"This is a good question and asks for a good answer"
I want to replace the good which only if it occurs somewhere between "for" and "answer" with bad