Skip to content

Instantly share code, notes, and snippets.

@PietrH
Created February 26, 2024 08:50
Show Gist options
  • Save PietrH/47701b02cb78a26eab4a25fdac8f17ef to your computer and use it in GitHub Desktop.
Save PietrH/47701b02cb78a26eab4a25fdac8f17ef to your computer and use it in GitHub Desktop.
str_extract in base R: extract a substring using regex
function(x, y) regmatches(x, regexpr(y, x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment