rex

Friendly regular expressions for R.

https://github.com/r-lib/rex

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords from Contributors

visualisation data-manipulation grammar rmarkdown latex book curl date-time pandoc literate-programming
Last synced: 9 months ago · JSON representation

Repository

Friendly regular expressions for R.

Basic Info
  • Host: GitHub
  • Owner: r-lib
  • License: other
  • Language: R
  • Default Branch: main
  • Homepage: https://rex.r-lib.org
  • Size: 4.81 MB
Statistics
  • Stars: 335
  • Watchers: 12
  • Forks: 27
  • Open Issues: 23
  • Releases: 1
Created over 11 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

Rex

Codecov test coverage Lifecycle: stable R-CMD-check <!-- badges: end -->

Friendly Regular Expressions

Regular expressions are very powerful feature, however they are often difficult to interpret. Rex allows you to build complex regular expressions from human readable expressions. So instead of writing (and later trying to decipher) r r <- "^(?:(((?:[^:])+)://))?((?:(?:(?!:/).)*)+)(?:(:([[:digit:]]+)))?(?:(/.*))?$"

You can write

```r r <- rex(

start,

## match the protocol -- may exist or may not maybe(capture( capture(exceptsomeof(":")), "://" )),

## match the path capture(oneormore(not(":/"))),

## get the port maybe(capture(":", capture(numbers))),

## and the rest maybe(capture("/", anything)),

end

) ```

While these expressions are a bit longer than their corresponding regular expression, they are much more readable and maintainable.

Installation

r install.packages("rex")

Usage

The vignettes have longer form usage examples.

Each rex() function call can include a number of functions and shortcuts. For a full list of the functions available please see ?rex and ?shortcuts.

Rex Mode

Rex functions are not exported because they are only useful within rex() calls, but they can be temporarily attached using rex_mode() which allows them to be auto-completed.

Using Rex in other packages

Using rex in other packages will generate spurious NOTEs from R CMD check unless you include a call to rex::register_shortcuts() with your package name somewhere in your package source. This function registers all of the rex shortcuts as valid variables fixing the NOTEs.

See Also

  • Regularity - Ruby library that partially inspired rex.
  • PCRE - Perl Compatible Regular Expressions, the engine that rex regular expressions use.
  • Perl 5 Regular Expressions - Perl regular expression documentation, which are nearly 100% compatible with PCRE.

Owner

  • Name: R infrastructure
  • Login: r-lib
  • Kind: organization

GitHub Events

Total
  • Issues event: 2
  • Watch event: 5
  • Issue comment event: 6
Last Year
  • Issues event: 2
  • Watch event: 5
  • Issue comment event: 6

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 205
  • Total Committers: 11
  • Avg Commits per committer: 18.636
  • Development Distribution Score (DDS): 0.2
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jim Hester j****r@g****m 164
RobertZK t****b@g****m 10
Kevin Ushey k****y@g****m 10
Hadley Wickham h****m@g****m 7
Michael Chirico c****m@g****m 6
Ryan C. Thompson r****t@t****g 2
Oliver Keyes I****s 2
yutannihilation y****i@g****m 1
Tim Taylor t****r@h****k 1
Salim B s****m@p****e 1
Jack Wasey j****y 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 58
  • Total pull requests: 37
  • Average time to close issues: 3 months
  • Average time to close pull requests: 20 days
  • Total issue authors: 23
  • Total pull request authors: 13
  • Average comments per issue: 1.69
  • Average comments per pull request: 1.32
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 1.25
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jimhester (20)
  • MichaelChirico (8)
  • fangly (3)
  • krlmlr (3)
  • robertzk (2)
  • peterhurford (2)
  • kevinushey (2)
  • hadley (2)
  • bramtayl (2)
  • kbzsl (1)
  • RLesur (1)
  • piccolbo (1)
  • DarwinAwardWinner (1)
  • TimTaylor (1)
  • FelixErnst (1)
Pull Request Authors
  • robertzk (11)
  • MichaelChirico (5)
  • hadley (4)
  • jimhester (3)
  • DarwinAwardWinner (3)
  • Ironholds (3)
  • debajyoti7 (2)
  • TimTaylor (2)
  • salim-b (1)
  • jackwasey (1)
  • trinker (1)
  • yutannihilation (1)
  • kevinushey (1)
Top Labels
Issue Labels
enhancement (3) help wanted (2) wontfix (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
proxy.golang.org: github.com/r-lib/rex
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • withr * imports
  • Hmisc * suggests
  • covr * suggests
  • dplyr * suggests
  • ggplot2 * suggests
  • knitr * suggests
  • magrittr * suggests
  • rmarkdown * suggests
  • roxygen2 * suggests
  • rvest * suggests
  • stringr * suggests
  • testthat * suggests