They are references to groups in the regex match. The groups are in
parenthesis. Whatever is matched by group 1 and 3 will be included in the
substitution.
https://regexr.com/ and
https://regex101.com/ are both good sites for
building and explaining regexes.