In the code below, I generate 10 fake emails and perform the operation that you want. As pointed out by @AlexisW, the function is str_match() in the stringr package. However, I use a different function: str_extract(), which is also in the stringr package.
library(stringr)
library(stringi)
# Generate fake emails
fake_emails <- paste0(stri_rand_strings(n = 10, length = 5), "@domain.", sample(c("com", "net", "org"), size = 10, replace = TRUE))
fake_emails
[1] "GNZuC@domain.net" "twed3@domain.com" "CAgNl@domain.com" "UizNm@domain.org" "vDe7G@domain.net" "N0NrL@domain.net" "TbUBp@domain.org" "fn6iP@domain.org"
[9] "oemYW@domain.net" "m1Tjg@domain.net"
# Extract string
str_extract(fake_emails, "\\w{3}$")
[1] "net" "com" "com" "org" "net" "net" "org" "org" "net" "net"