소스 검색

detect empty match

main
Garrick Aden-Buie 6 년 전
부모
커밋
2d1a45cccb
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. +1
    -0
      R/regex.R

+ 1
- 0
R/regex.R 파일 보기

@@ -39,6 +39,7 @@ regex <- function(
expand_matches <- function(m) {
if (m[1] == -1) return(NULL)
m_length <- attr(m, "match.length")
if (identical(as.vector(m[[1]]), 1L) && m_length == 0) return(NULL)
x <- purrr::map2(m, m_length, ~ c(.x, .x + .y))
x <- as.data.frame(do.call(rbind, x))
names(x) <- c("start", "end")

Loading…
취소
저장