regextools


regextools extends the devtools, roxygen2, & testthat packages to regular expressions library documentation, testing, and storage. The framework assumes the user will document and store regular expressions as an R package via the devtools, roxygen2, & testthat packages. This extends these existing frameworks to work make regular expression management easier for long term documentation, maintenance, and testing. The only change to these existing frameworks is that the user must include a tag @section Regex: TRUE in the roxygen2 markup, indicating the object is a regular expression.

regextools is a philosophy of regular expression management that sees unit testing and transparency of test coverage as an essential part of maintaining a regular expression library. In the spirit of transparent unit testing, regextools adds functions to test regular expressions, extending the testthat package. This avoids unforeseen breaks due to changes in a regular expression and explicitally describes the expression's intended behavior. regextools offers a template system that encourages this transparent unit testing philosophy through the use of GitHub, Travis-CI, and the covr package to indicate coverage in the GitHub README.md.

regextools also highlights the need for minimal, clear, description of a regular expression's behavior. regextools provides tools to generate html, .md, and .Rmd vignettes from existing roxygen2 markup rather than the more verbose package help documentation. Regular expressions are often difficult to parse, particularly as the expression's complexity grows. Visual presentation of the regular expression can enhance the maintainer and user's abilities to understand the expression's design. regextools includes a link/iframe of Debuggex's terrific visual diagram representation of regular expressions.

Development Version

Download the development version of regextools here

Help topics

Regular Expression Library Tools

Function for constructing and testing regular expressions.

Unit Testing Regular Expressions

Function for constructing and testing regular expressions.

Vignettes

Dependencies

  • Depends:
  • Imports: devtools, httr, jsonlite, rmarkdown
  • Suggests: knitr, testthat, qdapRegex, regexr
  • Extends: