According to my reading of https://github.com/google/re2/blob/main/doc/syntax.txt, ((?sm).*fprintf.*fclose.*) should allow for multiline matches to be treated as a single line to match printf on one line, fclose on another, but this does not seem to work.
I had a quick chat with Michael on Twitter and he confirmed he could see what I was saying, so I don't think it's just me (although that's still possible :)). I will take a look at RE2 myself to see if I can spot an upstream option, but Michael advised we ought to track it here also.