From c48a95ccebcf277c15bca718bd0d8d750bb8d6c0 Mon Sep 17 00:00:00 2001 From: Dave Slager Date: Tue, 13 Aug 2024 12:31:00 -0700 Subject: [PATCH] add regex code comment --- R/reproducibility_tables.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/reproducibility_tables.R b/R/reproducibility_tables.R index 44d78b9..cf668e4 100644 --- a/R/reproducibility_tables.R +++ b/R/reproducibility_tables.R @@ -196,6 +196,8 @@ get_session_info <- function(){ # Replacing @ with # in source my_session_info2$source <- gsub('\\(@', '(', my_session_info2$source) # Use short git hash + # find '@' followed by 40 hex digits, + # and substitute with the '@' and the first 7 hex digits in ()-captured group. my_session_info2$source <- sub( '([@][0-9a-f]{7})[0-9a-f]{33}', '\\1',