title: How To Apply Regex in Shiny App Filter/Button?
body: <p>I'm super new to Shiny Apps and to R. How would I add a button that allows me to filter the passed-in dataset using this regex? The uploaded dataset would all contain the same column names, and the column I want to apply the regex to is &quot;close_notes&quot;. I want to first <strong>convert this column to a string, uppercase everything, then apply the regex</strong>. Thank you so much for your help in advance!</p>
  <p>The Regular Expression:</p>
  <p><code>&quot;\\bMASTER DATA\\b|\\bSOURCE LIST\\b|\\bVALIDITY DATES\\b|\\bMRP CONTROLLER\\b|\\bPSV\\b|\\bELIGIBILITY\\b|\\bCOST\\b|\\bMARKETING EXCLUSION\\b|\\bEFFECTIVITY\\b|\\bMISSING\\b|\bbBLANK\\b&quot;</code></p>
  <p>The code below is for the Shiny App. Please let me know if anything looks wrong or like it should be modified. Thank you!</p>
  <pre><code>library(shiny)
  
  ui &lt;- fluidPage(
      sidebarLayout(
          sidebarPanel(
              fileInput(&quot;file1&quot;, &quot;Choose CSV File&quot;,
                        accept = c(
                            &quot;text/csv&quot;,
                            &quot;text/comma-separated-values,text/plain&quot;,
                            &quot;.csv&quot;)
              ),
              tags$hr(),
              checkboxInput(&quot;header&quot;, &quot;Header&quot;, TRUE),
              
              # Button
              downloadButton(&quot;downloadData&quot;, &quot;Download&quot;)
              
          ),
          mainPanel(
              dataTableOutput(&quot;contents&quot;)
          )
      )
  )
  
  server &lt;- function(input, output) {
      
      datasetInput &lt;- reactive({
          req(input$file1)
          # input$file1 will be NULL initially. After the user selects
          # and uploads a file, it will be a data frame with 'name',
          # 'size', 'type', and 'datapath' columns. The 'datapath'
          # column will contain the local filenames where the data can
          # be found.
          inFile &lt;- input$file1
          
          if (is.null(inFile))
              return(NULL)
          
          read.csv(inFile$datapath, header = input$header)
      })
      
      output$contents &lt;- renderDataTable({
          datasetInput()
      })
      
      output$downloadData &lt;- downloadHandler(
          filename = function() {
              paste(&quot;myfile&quot;,Sys.Date(), &quot;.csv&quot;, sep = &quot;&quot;)
          },
          content = function(file) {
              write.csv(datasetInput(), file, row.names = FALSE)
          }
      )
  }
  
  shinyApp(ui, server)
  </code></pre>