. . . . "I can always just do multiple full-match greps, or do some outside (non-R) processing, but I was hoping I can do it all within R. Is there is a function or a package that provides such a function to do this?" .