fork download
  1. getSheetID<-function(URL){
  2. regmatches(URL, regexpr("/spreadsheets/d/\\K[^/]+", URL, perl=TRUE))[1]
  3. }
  4.  
  5. x <- "https://docs.google.com/spreadsheets/d/crazyLongIDstring/edit"
  6. getSheetID(x)
  7.  
  8.  
Success #stdin #stdout 0.26s 39728KB
stdin
Standard input is empty
stdout
[1] "crazyLongIDstring"