Expand description
§Path-to-RegExp
§Installation
cargo add path2regex
§Features
§Usage
Similar to path-to-regex
§Differences
Thought that regex was not supported ?=
,The performance of the end
and ends_with
property in the configuration item will vary.
notice: regex executes captures
to get the result, providing the name END_WITH_DELIMITER
matching group to handle the extra endings
let re = path2regex::PathRegexBuilder::new("/test")
.set_end(false)
.build()
.unwrap();
// expected: Captures({0: Some("/test")})
// found: Captures({0: Some("/test"), "END_WIND_DELIMITER": Some("")})
println!("{:?}", re.captures("/test").unwrap());
// expected: Captures({0: Some("/test")})
// found: Captures({0: Some("/test/"), "END_WIND_DELIMITER": Some("")})
println!("{:?}", re.captures("/test/").unwrap());
// expected: Captures({0: Some("/test")})
// found: Captures({0: Some("/test/"), "END_WIND_DELIMITER": Some("/")})
println!("{:?}", re.captures("/test/route").unwrap());
Structs§
- Compiler
compile
- Path compiler
- Compiler
Builder compile
- The Builder of the
Compiler
- Compiler
Options compile
- The Configuration of the
Compiler
- Key
- Parameter matches in the path
- Match
Result match
- Regular matching results
- Matcher
match
- Path matcher
- Matcher
Builder match
- The Builder of the
Matcher
- Matcher
Options match
- The Configuration of the
Matcher
- Parser
- Path parser
- Parser
Builder - The Builder of the
Parser
- Parser
Options - The Configuration of the
Parser
- Path
Regex - Path regex
- Path
Regex Builder - The Builder of the
PathRegex
- Path
Regex Options - The Configuration of the
PathRegex
Enums§
- Token
- An abstract syntax tree node parsed by a path
Constants§
- DEFAULT_
DELIMITER - The matching trailing character is used for ‘end’ and ‘ends_with’ configuration item filtering