Basic shiny app to test regular expressions
The live version of the app is hosted and available on Heroku at https://retestr.herokuapp.com/
Or you can run the app locally by:
- cloning this repo
- opening the .Rproj file
- opening the global.R file
- hitting the run app button.
I liked sites like: regexr.com a lot. But one thing that was lacking was the ability to use pre-built character classes, which are compatible with the {stringr}
package in R.
So this testing sandbox allows for similar functionality but uses R and {stringr}
to locate the matches and then passes the location of the matches to a jquery plugin that does the highlighting.
You can enter the pattern you'd like to test in the top box.
You can enter any string you'd like to test that pattern against.
The highlighting will update when either change.
For info on pattern matching with {stringr}
: online documentation
Would be impossible without:
Tool | source |
---|---|
R | Get the latest version |
RStudio | Download link |
shiny | https://shiny.rstudio.com/ |
stringr | stringr site |
jquery | https://jquery.com/ |
jquery.highlightTextarea | index.html |