Attempting to match white space including newlines followed by a brace, {
or }
then collapse the matching white space to a single space,
.
Matches \s*([{}])
do not include the preceding newlines:
So, the replacement $1
does not collapse the newlines: