And what is the red "line?" A Polyline? Three independent Lines?
Manually, one way to do it is to Move the green Line so that its left end lies anywhere along the left red Line [or Polyline segment]. Then if the left red part is a Line, Copy it so that the temporary copy passes through the green Line's right end, and crosses the right red part. Or if the red is a Polyline, draw a temporary Line over the left segment and Move that over to the green Line's right end. Then Move the green line from its right end to the intersection of the right red part with the temporary Line.
That could perhaps be automated, but how to do so does depend on the answer to my first question.
Kent Cooper, AIA