Tried lots of solutions and none worked for me. After much trials and errors this is what worked for me (GNU Emacs 27.1 (build 1, x86_64-w64-mingw32) of 2020-08-22).
The idea is to match all blank lines that may or may not contain spaces at once (many solutions only match one blank line for each match), and then replace them with just one blank line. To ...
I have figured it out. It looks like the second argument can be either regexp or a function. So this worked for me:
(lambda (x) (format "\\\\%s" x))
"Major issue in [Bar] project")
;; => "Major issue in \\[Bar\\] project"
But ultimately, I still don't understand how other ...
It’s an explicitly–numbered group. From chapter 184.108.40.206 Backslash Constructs in Regular Expressions of the Emacs Lisp manual:
‘\(?: ... \)’
is the “shy group” construct. A shy group serves the first two
purposes of an ordinary group (controlling the nesting of other
operators), but it does not get a number, so you cannot refer back