\1the text saved by group 1
\W*any non-word character, repeated any number of times
Uses the first branch if group 2 matched
If the condition is true, match this branch:\2 \2the text saved by group 2
$end of string, or before its final line terminator