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.
In reply to Re: Isn't /m for multiline regex?
by jwkrahn
in thread Isn't /m for multiline regex?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |