[This article was first published on Maëlle's R blog on Maëlle Salmon's personal website, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. This week I took time to re-read The Programmer’s Brain by Felienne Hermans. Among the many gems one idea that stuck with me is that not learning how to do something and looking it up every time will make you less efficient.

Therefore I starting feeling bad about one particular thing I never get done on my own: extracting parts of a string, even in simple cases. Avoidance tactics For instance, how do you extract names from the following templated sentences? sentences [1] "Moomin" "Little My" "Snork Maiden" Looking up the regex syntax online (maybe even dutifully reading the stringr cheatsheet) or via a LLM. This could get me code calling stringr: stringr::str_extract(sentences, "My name is (.*).", group = 1) #> [1] "Moomin" "Little My" "Snork Maiden" # Look arounds stringr::str_extract(sentences, pattern = '(?