I have a large dataset that contains web domains. The domains end in a number of different top level domains such as .com, .app, .now and so on. I used the code below as i only want to keep the domains that end in the four below. However, when i run the code it keeps any domains that have the words com, net, tv or org. It seems to ignore the period. What can i use so it picks up on the period and only keeps the domains that end in the four below?
test <- new_df %>%
filter(grepl('.com|.net|.tv|.org', domain))