Skip to content

Instantly share code, notes, and snippets.

@brodieG
Created April 18, 2017 22:08
Show Gist options
  • Save brodieG/b648c113fd08d7d40b494bf25e73fb63 to your computer and use it in GitHub Desktop.
Save brodieG/b648c113fd08d7d40b494bf25e73fb63 to your computer and use it in GitHub Desktop.
Grep Stack Overflow
reg <- "(A|B)*" # overflow
reg <- "([AB])*" # works
string <- paste0(rep("A", 1e4), collapse="")
grep(reg, string, perl=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment