GithubHelp home page GithubHelp logo

gaelicgrime / r_regex_tester_app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamspannbauer/r_regex_tester_app

0.0 1.0 1.0 55.61 MB

Shiny Application to test regular expressions in R

Home Page: https://spannbaueradam.shinyapps.io/r_regex_tester/

License: Other

R 71.75% HTML 28.25%

r_regex_tester_app's Introduction

R Regex Tester Shiny App

Build Status Codecov test coverage CRAN_Status_Badge Last Commit

Usage

Online

Local

  • Install from GitHub with devtools
devtools::install_github("AdamSpannbauer/r_regex_tester_app")
  • Run app
regexTestR::run_app()

Features

Options

  • The other 2 options concerning backslashes allow you to write an R flavored regex.
    • For example, if you want to match a literal period with a regex you'll type "\\." (as if you were writing the regex in R).
    • If you don't like this behavior, and you'd rather type half of the slashes needed to make the regex functional in R, you can select the "Auto Escape Backslashes" option for "Pattern" and then use "\." to match literal periods in the app.

Input

  • There are 2 text inputs:
    1. Matching Pattern: type the regular expression or fixed pattern here that you want to use to match against your text.
    2. Test String: type the text that you want your Matching Pattern to search through

Results

  • After the pattern and test string are entered we see 2 different versions of the resulting pattern matching:
    1. The test string is shown with the matches/capture groups highlighted where they appear in the text
      • As noted in the UI, currently nested capture group highlighting isn't supported. If our matching pattern was "t(e(s))(t)" the highlighting wouldn't display correctly.
    2. The second output is a bulleted list of the matches and capture groups found in our test string. In the screen shot below we see we matched 2 instances of "test", and each of these matches display below them the contents of the 2 capture groups we included in our regex pattern.

Regex Explanation

  • There's additionally a collapsable panel that will do it's best to break down your regex and explain the components. As noted in the UI these explanations are provided by rick.measham.id.au
  • The screen shot below shows the explanation for our regex: "t(es)(t)"

Helping Documentation

  • The app includes some documentation for using regular expressions in R. The two including pieces of helping documentaion are:
    1. The RStudio Regex Cheatsheet
    2. The base R documentation on regex (this is what would appear if you ran the command ?regex)

Extra

Shiny's bootstrap roots allow apps to transition between desktop and mobile pretty seamlessly. The app's mobile experience isn't terrible, so you can use it for all your regex-ing fun on the go! (I won't ask why)

r_regex_tester_app's People

Contributors

adamspannbauer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.