^start of line
\h*any horizontal whitespace character, repeated any number of times
\[the literal [ (9110 / 1338 / 5B16)
ifthe literal text if (case sensitive) .*any character (except for line terminators), repeated any number of times
\]the literal ] (9310 / 1358 / 5D16)
\Ra newline sequence
Comment: if in the first line
Group if(?<if>(?:(?!\[elseif)[\s\S])+) Non-Capturing Group(?:(?!\[elseif)[\s\S])+ +repeats the group contents below at least once:
Negative Lookahead(?!\[elseif) \[the literal [ (9110 / 1338 / 5B16)
elseifthe literal text elseif (case sensitive) \sany whitespace character
\Sany non-whitespace character
\Ra newline sequence
Comment: output
^start of line
\h*any horizontal whitespace character, repeated any number of times
\[the literal [ (9110 / 1338 / 5B16)
elseifthe literal text elseif (case sensitive) .*any character (except for line terminators), repeated any number of times
\]the literal ] (9310 / 1358 / 5D16)
\Ra newline sequence
Comment: elseif
Group elseif(?<elseif>(?:(?!\[else)[\s\S])+) Non-Capturing Group(?:(?!\[else)[\s\S])+ +repeats the group contents below at least once:
Negative Lookahead(?!\[else) \[the literal [ (9110 / 1338 / 5B16)
elsethe literal text else (case sensitive) \sany whitespace character
\Sany non-whitespace character
\Ra newline sequence
Comment: output
^start of line
\h*any horizontal whitespace character, repeated any number of times
\[the literal [ (9110 / 1338 / 5B16)
elsethe literal text else (case sensitive) .*any character (except for line terminators), repeated any number of times
\]the literal ] (9310 / 1358 / 5D16)
\Ra newline sequence
Comment: elseif
Group else(?<else>(?:(?!\[endif)[\s\S])+) Non-Capturing Group(?:(?!\[endif)[\s\S])+ +repeats the group contents below at least once:
Negative Lookahead(?!\[endif) \[the literal [ (9110 / 1338 / 5B16)
endifthe literal text endif (case sensitive) \sany whitespace character
\Sany non-whitespace character
\Ra newline sequence
Comment: output
^start of line
\[the literal [ (9110 / 1338 / 5B16)
endifthe literal text endif (case sensitive) \]the literal ] (9310 / 1358 / 5D16)
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
x modifier: extended. Ignores unescaped whitespace and comments outside character classes