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

View source: R/path.R

new_regexpR Documentation

Create a new regular expression to use in webfakes routes

Description

Note that webfakes uses PERL regular expressions.

Usage

new_regexp(x)

Arguments

x

String scalar containing a regular expression.

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.

Value

String with class webfakes_regexp.

See Also

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

Examples

new_regexp("^/api/match/(?<pattern>.*)$")

webfakes documentation built on Oct. 1, 2023, 9:06 a.m.