Learn R Programming

presser (version 1.1.0)

new_regexp: Create a new regular expression to use in presser routes

Description

Note that presser uses PERL regular expressions.

Usage

new_regexp(x)

Arguments

x

String scalar containing a regular expression.

Value

String with class presser_regexp.

Details

As R does not have data type or class for regular expressions, you can use new_regexp() to mark a string as a regular expression, when adding routes.

See Also

The 'Path specification' and 'Path parameters' chapters of the manual of new_app().

Examples

Run this code
# NOT RUN {
new_regexp("^/api/match/(?<pattern>.*)$")
# }

Run the code above in your browser using DataLab