C-q C-j to specify a newline in the pattern to match or replace with. Plain text and regexp are supported, either all at once or in query mode (get confirmation for each match).
The functions you want are
and they can all be invoked with
M-x <function name>. Some have default bindings.
C-h f <function-name> to learn what binding is currently assigned to any function.
To select a block from the text to use
- More the point to one end of the block. Hit
- Move the point to the other end. Hit
C-w which will yank the whole block then
C-y to return the yanked block or invoke
M-x <function> then
C-y to paste the block into the search space. Newlines are handled naturally.
- proceed as normal.