^start of line
.*?any character (except for line terminators), repeated any number of times
\Kresets the starting point of the reported match. Any previously consumed characters are no longer included in the final match
Non-Capturing Group(?:((?(1)\1)1).*?)* *repeats the group contents below any number of times:
Uses the first branch if group 1 matched
If the condition is true, match this branch:\1 \1the text saved by group 1
1the literal 1 (4910 / 618 / 3116)
.*?any character (except for line terminators), repeated any number of times
(?1)calls group 1 as a subroutine
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string
g modifier: global. Finds all matches instead of stopping after the first