This part uses the regex which targets a word and then a space and then another word. Then it applies the second word to the front and the first word to the last. There is A LOT more happening than what I explained, but that’s the basic of what is happening.
\w+ means grab a word one or more times \s means grab a space $2 and $1 means to grab the matched words and align . $ means start of a string or end of astring depending on where it is put