I would like to detect one or more repeated characters within a class of characters, but not a combination of unique characters within the class. In the example below, we're looking for instances of p's, t's, or k's before an r. All three words satisfy the regular expression below, but I would like to exclude cases like bektri where we have two different consonants before r.
example <- c("betri", "bettri", "bektri")
str_detect(example, "[ptk]r")
So betri and bettri are good, but bektri is bad. Any tips?