for consistency with base and stringr argument names. Left "Send regex to console" button text same for consistency with tabs in gadget.tags/v0.1.3
| observeEvent(input$done, { | observeEvent(input$done, { | ||||
| # browser() | # browser() | ||||
| if (pattern() != "") { | if (pattern() != "") { | ||||
| pattern <- paste0('regex <- "', escape_backslash(pattern()), '"') | |||||
| pattern <- paste0('pattern <- "', escape_backslash(pattern()), '"') | |||||
| rstudioapi::sendToConsole(pattern, FALSE) | rstudioapi::sendToConsole(pattern, FALSE) | ||||
| } | } | ||||
| stopApp() | stopApp() |
| runGadget(ui, server, viewer = viewer) | runGadget(ui, server, viewer = viewer) | ||||
| } | } | ||||
| # ---- Help - Shiny Module ---- | |||||
| help_ui <- function(id) { | help_ui <- function(id) { | ||||
| ns <- NS(id) | ns <- NS(id) | ||||
| When you're done, click on the **Send Regex to Console** to send your regex expression to... the console! | When you're done, click on the **Send Regex to Console** to send your regex expression to... the console! | ||||
| ```r | ```r | ||||
| > regex <- "(is|were|was) ([[:alpha:]]+) ([[:alpha:]]+)" | |||||
| > pattern <- "(is|were|was) ([[:alpha:]]+) ([[:alpha:]]+)" | |||||
| ``` | ``` | ||||
| ### Additional Addins | ### Additional Addins |
| regex expression to… the console\! | regex expression to… the console\! | ||||
| ``` r | ``` r | ||||
| > regex <- "(is|were|was) ([[:alpha:]]+) ([[:alpha:]]+)" | |||||
| > pattern <- "(is|were|was) ([[:alpha:]]+) ([[:alpha:]]+)" | |||||
| ``` | ``` | ||||
| ### Additional Addins | ### Additional Addins |