ExpressPathToRegex.path_to_regex
— FunctionNormalize the given path array, returning a regular expression.
An empty array can be passed in for the keys, which will hold the placeholder key descriptions. For example, using /user/:id
, keys
will contain [{ name: 'id', delimiter: '/', optional: false, repeat: false }]
.
ExpressPathToRegex.path_to_regex
— FunctionPull out keys from a regexp.
ExpressPathToRegex.path_to_regex
— FunctionNormalize the given path string, returning a regular expression.
An empty array can be passed in for the keys, which will hold the placeholder key descriptions. For example, using /user/:id
, keys
will contain [{ name: 'id', delimiter: '/', optional: false, repeat: false }]
.
ExpressPathToRegex.path_regex
— ConstantThe main path matching regexp utility.
ExpressPathToRegex.compile
— MethodCompile a string to a template function for the path.
ExpressPathToRegex.escape_group
— MethodEscape the capturing group by escaping special characters and meaning.
ExpressPathToRegex.escape_string
— MethodEscape a regular expression string.
ExpressPathToRegex.flags
— MethodGet the flags for a regexp from the options.
ExpressPathToRegex.parse
— MethodParse a string for the raw tokens.
ExpressPathToRegex.tokens_to_function
— MethodExpose a method for transforming tokens into the path function.
ExpressPathToRegex.tokens_to_regex
— MethodExpose a function for taking tokens and returning a RegExp.