Use a disposable Text-mode buffer for this example. Insert these three lines:
The draft is ready. Keep this draft for comparison. The draft outside the selection must stay unchanged.
draft
and press RET; at the second enter version and press RET. These are
answers to successive prompts, not text inserted into the document.
version. The second was skipped and the third was outside the selection.
M-x query-replace RET is an alternative when Meta-percent is difficult to enter. The active region limits the operation under normal Transient Mark mode; without it, ordinary forward query replacement works from point towards the accessible buffer end. Do not deactivate or replace the checked mark between selection and starting the command. For a full-document operation, first abandon unrelated selection and deliberately choose the starting point.
At a replacement question, q or RET stops without changing further matches; earlier replacements remain. Comma, ,, replaces the current match and lets you review it before advancing. ! replaces the remaining matches without more questions and is not needed for this guided task. Other editing keys can leave the replacement loop and then act on the document. Rely on the automatic match reading, or stop before issuing ordinary speech/editing keys.
Check the result before saving. Use Recover a text edit before saving if the scope or replacement was wrong. Replacement commands and Query replace in the GNU Emacs Manual cover exact matching, case behaviour and the full set of answers. Regular-expression replacement is a different, more specialised task.