RVerbalExpressions

:speech_balloon: Create regular expressions easily

Github星跟踪图

RVerbalExpressions

Travis build
status
AppVeyor Build
status
CRAN
status
CRAN\_Download\_Badge
Codecov test
coverage

The goal of RVerbalExpressions is to make it easier to construct
regular expressions using grammar and functionality inspired by
VerbalExpressions. Usage of
%>% is encouraged to build expressions in a chain like fashion.

Installation

Install the released version of RVerbalExpressions from
CRAN:

install.packages("RVerbalExpressions")

Or install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("VerbalExpressions/RVerbalExpressions")

Example

This is a basic example which shows you how to build a regular
expression:

library(RVerbalExpressions)

# construct an expression
x <- rx_start_of_line() %>% 
  rx_find('http') %>% 
  rx_maybe('s') %>% 
  rx_find('://') %>% 
  rx_maybe('www.') %>% 
  rx_anything_but(' ') %>% 
  rx_end_of_line()

# print the expression
x
#> [1] "^(http)(s)?(\\://)(www\\.)?([^ ]*)$"

# test for a match
grepl(x, "https://www.google.com")
#> [1] TRUE

Other Implementations

You can see an up to date list of all ports on
VerbalExpressions.github.io.

Additionally, there are two R packages that try to solve the same
problem. I encourage you to check these out:

  1. rex by
    @kevinushey
  2. rebus by
    @richierocks

Contributing

If you find any issues, typos, etc., please file an issue or submit a
PR. All contributions are welcome!

主要指标

概览
名称与所有者VerbalExpressions/RVerbalExpressions
主编程语言R
编程语言R (语言数: 1)
平台
许可证Other
所有者活动
创建于2019-03-01 23:44:40
推送于2024-03-20 16:35:55
最后一次提交2024-03-20 09:35:52
发布数1
最新版本名称v0.1.0 (发布于 )
第一版名称v0.1.0 (发布于 )
用户参与
星数280
关注者数8
派生数12
提交数124
已启用问题?
问题数18
打开的问题数8
拉请求数8
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?