^start of line
Positive Lookahead(?=[%§#]+$) +matches at least one character from the set below:
%the literal % (3710 / 458 / 2516)
§the literal § (16710 / 2478 / A716)
#the literal # (3510 / 438 / 2316)
$end of line
.any character (except for line terminators)
.*any character (except for line terminators), repeated any number of times
\1the text saved by group 1
.any character (except for line terminators)
.*any character (except for line terminators), repeated any number of times
Negative Lookahead(?!\1|\2) \1the text saved by group 1
\2the text saved by group 2
.any character (except for line terminators)
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