(?mi)applies the following effective flags to the remainder of the pattern: gmxi m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string
i modifier: insensitive. Matches without distinguishing uppercase and lowercase letters
^start of line
\h*any horizontal whitespace character, repeated any number of times
\#the literal # (3510 / 438 / 2316)
Atomic Group(?>cs|comments-start) csthe literal text cs (case insensitive) 2nd Alternativecomments-start comments-startthe literal text comments-start (case insensitive) Comment: start of comment block
Group with flags gmxisU(?sU:(?>(?&CommentBlock)|.)*) s modifier: single line. Allows a dot to match line terminators
U modifier: Ungreedy. Quantifiers are lazy by default. A trailing ? makes a quantifier greedy
Atomic Group(?>(?&CommentBlock)|.)* *repeats the group contents below any number of times:
1st Alternative(?&CommentBlock) (?&CommentBlock)calls group CommentBlock as a subroutine
Comment: content of comment block (could be nested)
^start of line
\h*any horizontal whitespace character, repeated any number of times
\#the literal # (3510 / 438 / 2316)
Atomic Group(?>ce|comments-end) cethe literal text ce (case insensitive) 2nd Alternativecomments-end comments-endthe literal text comments-end (case insensitive) .*any character (except for line terminators), repeated any number of times
\Ra newline sequence
Comment: end of comment block