in reply to Isn't /m for multiline regex?

The /m option affects the use of the  ^ and  $ anchors, but you are not using those anchors in your pattern.

You need to use the /s option so that the  . character class will match a newline as well as every other character.