finite automata – Modeling the replacement of regular expressions via a DFA

I wish to model the following common construct in code via a finite state automaton for the purpose of static analysis:

``````s =
t = instead (, )
# What is the set of possible strings of t?
``````

More formally, from the DFA $$R_1$$, $$R_2$$, and $$R_3$$, I want to find an automaton $$R_o$$ it is the result of the replacement of the substrings of $$R_1$$ which are accepted by $$R_2$$ by a string that is accepted by $$R_3$$.

Unfortunately, while the literature seems to be discussing it, I can not precisely define the implementation of this operation. In addition, I have trouble defining the string set $$R_o$$ should accept. Is there an algorithm to solve this problem? Is it even soluble in general?