It's common to use Sed (or Perl or Ruby) to replace things in a file:
sed -i.bak 's/\s+\\{/ {/g' some.code
In this example I want to remove line breaks before curly braces in code, since they are not part of my programming 'dialect' (for any language I use) and make reading the code less natural and smooth. But the basic problem is how to match a pattern that spans lines, rather than a pattern that is within any given line of the file.
Existing SO questions that appear to be similar did not specifically address how to span across lines in general, but instead gave solutions to the specific problem the user was trying to solve, sometimes through workarounds instead.
I poked around in the Sed man pages and couldn't find any switches to do what I'm describing. Perhaps I'm just not looking with the right keywords, though.