Skip to content

Instantly share code, notes, and snippets.

@anilyayavar
Created April 11, 2024 07:26
Show Gist options
  • Save anilyayavar/f2fcbf85809d45bbad6e5c0d7ee19fc6 to your computer and use it in GitHub Desktop.
Save anilyayavar/f2fcbf85809d45bbad6e5c0d7ee19fc6 to your computer and use it in GitHub Desktop.
library(readxl)
library(janitor)
df <- read_xlsx("PQ/PQ_Challenge_169.xlsx", range = cell_cols(LETTERS[1]))
df %>%
mutate(Codes = map_chr(String, ~ str_extract_all(.x, pattern = "(?<=\\b)[A-Z]+\\d+[A-Z0-9]+(?=\\b)") %>%
unlist() %>%
str_c(collapse = ", ")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment