How to use multiline flag in regex policy

I'm using line boundaries (^$) in my regex pattern and it is not working as expected for validating json request content. I think its bcoz of not using multiline flag in my regex pattern. Can someone tell me on how to use multiline flag in regex policy.
Let me put this scenario in a simple example.

Eg: Here i want to restrict "teja" using line boundaries then the regex pattern will look like this (^teja$), this pattern is working as expected in headers, queryparams & formparams but not in json request content validation. And im guessing this is not working as expected bcoz of not using multiline flag. 
Please help me on how to use multiline in regex pattern. Thanks in advance.

@dchiesa1 

0 1 78
1 REPLY 1

Prefix your regex with one or both of these: 

  •  (?m) - the regex will allow the anchors ^ and $ to match at the start and end of each line . otherwise they only match at the start/end of the entire string. 
  • (?s) - allow the dot to match newline characters.