|
|
|
|
|
|
|
|
#' @param text Text to search |
|
|
#' @param text Text to search |
|
|
#' @param pattern regexp |
|
|
#' @param pattern regexp |
|
|
#' @param global If `TRUE`, enables global pattern matching |
|
|
#' @param global If `TRUE`, enables global pattern matching |
|
|
#' @inheritDotParams base::regexec ignore.case perl fixed useBytes |
|
|
|
|
|
|
|
|
#' @inheritParams base::regexec |
|
|
run_regex <- function( |
|
|
run_regex <- function( |
|
|
text, |
|
|
text, |
|
|
pattern, |
|
|
pattern, |
|
|
|
|
|
|
|
|
collapse_span_inserts(inserts) |
|
|
collapse_span_inserts(inserts) |
|
|
} else { |
|
|
} else { |
|
|
inserts %>% |
|
|
inserts %>% |
|
|
tidyr::nest(-pass) %>% |
|
|
|
|
|
mutate(data = purrr::map(data, collapse_span_inserts)) %>% |
|
|
|
|
|
|
|
|
tidyr::nest(-.data$pass) %>% |
|
|
|
|
|
mutate(data = purrr::map(.data$data, collapse_span_inserts)) %>% |
|
|
tidyr::unnest() %>% |
|
|
tidyr::unnest() %>% |
|
|
group_by(loc, type) %>% |
|
|
|
|
|
summarize(insert = paste(insert, collapse = "")) %>% |
|
|
|
|
|
|
|
|
group_by(.data$loc, .data$type) %>% |
|
|
|
|
|
summarize(insert = paste(.data$insert, collapse = "")) %>% |
|
|
dplyr::ungroup() |
|
|
dplyr::ungroup() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inserts_other, |
|
|
inserts_other, |
|
|
filter(inserts_g0, type == "end") |
|
|
filter(inserts_g0, type == "end") |
|
|
) %>% |
|
|
) %>% |
|
|
mutate(type = sprintf("%05d%s", 1:nrow(.), type)) %>% |
|
|
|
|
|
|
|
|
mutate(type = sprintf("%05d%s", dplyr::row_number(), type)) %>% |
|
|
group_by(.data$loc, .data$type) %>% |
|
|
group_by(.data$loc, .data$type) %>% |
|
|
summarize(insert = paste(.data$insert, collapse = '')) %>% |
|
|
summarize(insert = paste(.data$insert, collapse = '')) %>% |
|
|
dplyr::ungroup() %>% |
|
|
dplyr::ungroup() %>% |