Skip to content

Commit 6efaf97

Browse files
committed
Restore check for length of pattern vs result in str_extract_all().
1 parent 0f005d2 commit 6efaf97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/extract.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ str_extract_all <- function(string, pattern, simplify = FALSE) {
7878
simplify = simplify, omit_no_match = TRUE, opts_regex = opt)
7979
)
8080
if (simplify) {
81-
rownames(out) <- names(string)
81+
if (nrow(out) == length(string)) rownames(out) <- names(string)
8282
} else {
83-
names(out) <- names(string)
83+
if (length(out) == length(string)) names(out) <- names(string)
8484
}
8585
out
8686
}

0 commit comments

Comments
 (0)