^start of line
Negative Lookahead(?!To:|Subject:) To:the literal text To: (case sensitive) Subject:the literal text Subject: (case sensitive) .*any character (except for line terminators), repeated any number of times
$end of line
\r*a carriage return (ASCII 13), repeated any number of times
\n*a line-feed (newline) character (ASCII 10), repeated any number of times
g modifier: global. Finds all matches instead of stopping after the first
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string