(?s)applies the following effective flags to the remainder of the pattern: gms s modifier: single line. Allows a dot to match line terminators
^start of line
\s*any whitespace character, repeated any number of times
\ban ASCII word boundary
Onthe literal text On (case sensitive) \ban ASCII word boundary
.*any character, repeated any number of times
\na line-feed (newline) character (ASCII 10)
wrote:the literal text wrote: (case sensitive) .*any character, repeated any number of times
$end of line
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