^start of string
.+any character (except for line terminators), repeated at least once
Non-Capturing Group(?:.*) .*any character (except for line terminators), repeated any number of times
\1+the text saved by group 1, repeated at least once
\2?optionally matches the text saved by group 2
$end of string, or before its final line terminator