Description Usage Arguments Examples
This function allows the match syntax to mimic perl's very closely. As in perl the first character is used as a delimiter to separate the regular expression and options. Paired delimiters are supported as in perl, so both '/this/' and 'this' are both supported for instance.
1 |
pattern |
a character delimited regular expression pattern like those in perl |
data |
character vector to match against |
1 2 3 4 5 6 7 8 9 10 | string = c('this is a Test', 'string')
string %m% '/test/i'
#paired delimiters
string %m% '{test}i'
#captures return numbered results
string %m% '!(string)!'
#named captures
string %m% '/(?<type>string)/'
# g option also
string %m% '{(\\w+)}g'
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.