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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?