I have two datasets containing identifiers of some of the same individuals.

`df1` is more complete and has three variables: (1) the name of the individual, (2) a regional registration id, (3) the region code where the id was registered.

`df2` only informs (1) and (2) (i.e., name and regional registration id, but not the region code).

Individuals are uniquely identified by region code *and* regional registration id. Different regions may inform the same id number. Besides, the same individual always has the *same* regional registration id across the two datasets, but may not have the exact same spelling of their name across these datasets.

I would like to add the region code to `df2` by matching each one of its rows to `df1` using as key variables the *exact* regional registration id as well as the *closest* name between the datasets (the one that has the most similar spelling). Consider the example below:

```
library("tidyverse")

df1 <- data.frame(name = c("flaviasillva", "flaviasilvaa", "rodrigomaia", "mariaconceicao",
                               "felipesantos", "mateussauro",
                               "flaviasilva",
                               "abrahaoemidiopedreiradealbuquerque"),
                      regional_registration_id = c(rep(1,4),
                                                   rep(2,2),
                                                   3,
                                                   4),
                      region_code = c("A", "B", "C", "D",
                                      "B", "D",
                                      "F",
                                      "Z"))

df2 <- data.frame(name = c("flaviasilva", "rodrigommaia", "filipesantos", "abrahaoemidiopdealbuquerque"),
             regional_registration_id = c(1, 1, 2, 4))

```

My desired output should be:

```
                         name regional_registration_id region_code
1                 flaviasilva                        1           A
2                 flaviasilva                        1           B
3                filipesantos                        2           B
4 abrahaoemidiopdealbuquerque                        4           Z

```