What I want
A convenient way (with preview, interactivity) to replace regex multi-line matches across many files
What I already have
I know how to do this for single-line matches. I use counsel-rg, open ivy-occur buffer with C-c o, and can make my edits there.
Multi-line search works, and I can see the replacement candidates, but replacement is painful.
Why what I have is not enough
The crux of the problem is that file-names and line numbers in ivy-occur buffer are read-only, and regex-replace fails if any part of read-only text is matched.
Here's an example of search results ivy-occur for regex :PROPERTIES:\n.*?\n:END::
60 candidates: ./README.org:1::PROPERTIES: ./README.org:2::header-args: :comments link :noweb yes ./README.org:3::END: ./README.org:6::PROPERTIES: ./README.org:7::ID: 41e08286-2ccc-4c5b-b1ed-10d7dde499d3 ./README.org:8::END: ... I can get creative, and use something like negative look-behind (?<=org:\d*?:) from pcre2el package, to make edits line-by-line and not touching read-only text in the buffer. But this seems like a lot of hoops to jump through for a simple operation.
:PROPERTIES:\n.*\n.*:END:match?:PROPERTIES:and:END:you need a bit more in the middle: you need to group the.*\nthat matches a single line and apply*?or+?on the group.