The enzyme that matches nucleotides in the nucleus is called DNA polymerase.
This happens during the process of DNA replication, that is when new copies of DNA are being made jus before being transferred into new daughter cells.
During this process, the two strands of DNA are separated up to a certain point. DNA polymerase then uses each strand as template for making a new strand, and does this by joining new nucleotides into a new strand as it reads the old DNA strand.
After this, it proof reads the new strand and corrects any mistakes. The two new strands finally get joined together to form the new DNA.