Vim interprets characters within character classes [ ... ] differently. This is not literal, as this regular expression will not fully match lambda {sss or lambda {\\\ . What \s and \s interpreted as ... I still cannot explain.
However, I was able to achieve almost what I wanted:
%s/lambda\s*{\([\n a-zA-z]\)*//gc
This ignores the punctuation I wanted. This works, but is dangerous:
%s/lambda\s*{\([\n a-zA-z]\|.\)*//gc
Since adding a character after the last character, such as } , causes vim to hang during globbing. So my solution was to add the punctuation that I need to the character class.
source share