.any character (except for line terminators)
Negative Lookahead(?!.*\1) .*any character (except for line terminators), repeated any number of times
\1the text saved by group 1
.any character (except for line terminators)
\2{2}the text saved by group 2, repeated exactly 2 times
Negative Lookahead(?!\2{1,4}) \2{1,4}the text saved by group 2, repeated between 1 and 4 times
.any character (except for line terminators)
\3{1}the text saved by group 3, repeated exactly 1 time
Negative Lookahead(?!\3{1,2}) \3{1,2}the text saved by group 3, repeated between 1 and 2 times
.any character (except for line terminators)
\4{1}the text saved by group 4, repeated exactly 1 time
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