Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Jan 5, 2025
1 parent 59f35b6 commit 4852a53
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions crates/core/src/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@
//! `{id}` matches a fragment in the path, under normal circumstances, the article `id` is just a number, which we can
//! use regular expressions to restrict `id` matching rules, `r"{id|\d+}"`.
//!
//! For numeric characters there is an easier way to use `<id:num>`, the specific writing is:
//! For numeric characters there is an easier way to use `{id:num}`, the specific writing is:
//!
//! - `<id:num>`, matches any number of numeric characters;
//! - `<id:num[10]>`, only matches a certain number of numeric characters, where 10 means that the match only matches
//! - `{id:num}`, matches any number of numeric characters;
//! - `{id:num[10]}`, only matches a certain number of numeric characters, where 10 means that the match only matches
//! 10 numeric characters;
//! - `<id:num(..10)>` means matching 1 to 9 numeric characters;
//! - `<id:num(3..10)>` means matching 3 to 9 numeric characters;
//! - `<id:num(..=10)>` means matching 1 to 10 numeric characters;
//! - `<id:num(3..=10)>` means match 3 to 10 numeric characters;
//! - `<id:num(10..)>` means to match at least 10 numeric characters.
//! - `{id:num(..10)}` means matching 1 to 9 numeric characters;
//! - `{id:num(3..10)}` means matching 3 to 9 numeric characters;
//! - `{id:num(..=10)}` means matching 1 to 10 numeric characters;
//! - `{id:num(3..=10)}` means match 3 to 10 numeric characters;
//! - `{id:num(10..)}` means to match at least 10 numeric characters.
//!
//! You can also use `{**}`, `{*+*}` or `{*?}` to match all remaining path fragments.
//! In order to make the code more readable, you can also add appropriate name to make the path semantics more clear,
Expand Down Expand Up @@ -367,7 +367,7 @@
//! ```
//!
//! You only need to register once, and then you can directly match the GUID through the simple writing method as
//! `<id:guid>`, which simplifies the writing of the code.
//! `{id:guid}`, which simplifies the writing of the code.
pub mod filters;
pub use filters::*;
Expand Down

0 comments on commit 4852a53

Please sign in to comment.