Learn R Programming

pater (version 1.0.0)

match: Build a function for matching pathnames against a pathname specification

Description

Build a function for matching pathnames against a pathname specification

Usage

match(path, decode = NULL, delimiter = "/", ...)

Value

A function.

Arguments

path

A character vector of length 1. A pathname specification.

decode

A function for decoding a string or FALSE to disable it.

delimiter

A character vector of length 1. Specifies the delimiter for the path segments.

...

Additional parameters for pathToRegexp or parse.

Examples

Run this code

path <- "/users/:userId/books/:bookId/*public"
fn <- match(path)
p <- fn("/users/User1/books/Id1/2/3")
p

path <- "/path/resource"
fn <- match(path)
fn("/resource/path")


Run the code above in your browser using DataLab