perlrer: 'perlrer' Use perl regular expressions in R!

Description Examples

Description

This package aims to bring common perl regular expression functonality to R There are two major functions, m for regular expression matching and s for substitution

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(perlrer)
string = 'This is a test'

#using the functional style
m(string, 'this', 'i')
#using the perl infix function style
string %m% '/this/i'

#substitutions
string = 'This is a test'
s(string, 'this', 'that', 'i')
string %s% '/this/that/i'

#perl join and split for strings
pjoin(' ', string)
psplit(' ', string)

jimhester/perlrer documentation built on May 19, 2019, 10:33 a.m.