powered by
Build a function for matching pathnames against a pathname specification
match(path, decode = NULL, delimiter = "/", ...)
A function.
A character vector of length 1. A pathname specification.
A function for decoding a string or FALSE to disable it.
A character vector of length 1. Specifies the delimiter for the path segments.
Additional parameters for pathToRegexp or parse.
pathToRegexp
parse
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