Regular expressions. How they can be cruel! Well we’re here to make them a tad easier. To do so we’re going to make use of the {stringr} package install.packages("stringr") library("stringr") We’re going to use the str_detect() and str_subset() functions. In particular the latter. These have the syntax function_name(STRING, REGEX_PATTERN) str_detect() is used to detect whether a string contains a certain pattern. At the most basic use of these functions, we can match strings of text.