Skip to content

Commit

Permalink
orTextual: fixed bug where element would be selected because of match…
Browse files Browse the repository at this point in the history
…ing sub string
  • Loading branch information
HendrikSchultheis committed Jun 25, 2019
1 parent 82ce2c3 commit b0dd242
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/orTextual.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ orTextual <- function(input, output, session, choices, selected = NULL, label =
esc_choices <- paste0("\\Q", input$column, "\\E")

if (contains | !is.null(delimiter)) {
result <- grepl(pattern = paste0(esc_choices, paste0("($|", delimiter, ")"), collapse = "|"), raw_choices, perl = TRUE)
print(paste0(paste0("(^|", delimiter, ")"), esc_choices, paste0("($|", delimiter, ")"), collapse = "|"))
result <- grepl(pattern = paste0(paste0("(^|", delimiter, ")"), esc_choices, paste0("($|", delimiter, ")"), collapse = "|"), raw_choices, perl = TRUE)
} else {
result <- grepl(pattern = paste0("^(", esc_choices, ")$", collapse = "|"), raw_choices, perl = TRUE)
}
Expand Down

0 comments on commit b0dd242

Please sign in to comment.