How to extract all matching patterns (words in a string) in a dataframe column?
问题 I have two dataframes. one ( txt.df ) has a column with a text I want to extract phrases from ( text ). The other ( wrd.df ) has a column with the phrases ( phrase ). both are big dataframes with complex texts and strings but lets say: txt.df <- data.frame(id = c(1, 2, 3, 4, 5), text = c("they love cats and dogs", "he is drinking juice", "the child is having a nap on the bed", "they jump on the bed and break it", "the cat is sleeping on the bed")) wrd.df <- data.frame(label = c('a', 'b', 'c',