From 4852a534bde25e4ba2e5d06a6c3290b101e27bd1 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Sun, 5 Jan 2025 10:16:11 +0800 Subject: [PATCH] update doc --- crates/core/src/routing/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/core/src/routing/mod.rs b/crates/core/src/routing/mod.rs index 0f03bb524..d983974f0 100644 --- a/crates/core/src/routing/mod.rs +++ b/crates/core/src/routing/mod.rs @@ -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 ``, the specific writing is: +//! For numeric characters there is an easier way to use `{id:num}`, the specific writing is: //! -//! - ``, matches any number of numeric characters; -//! - ``, 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; -//! - `` means matching 1 to 9 numeric characters; -//! - `` means matching 3 to 9 numeric characters; -//! - `` means matching 1 to 10 numeric characters; -//! - `` means match 3 to 10 numeric characters; -//! - `` 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, @@ -367,7 +367,7 @@ //! ``` //! //! You only need to register once, and then you can directly match the GUID through the simple writing method as -//! ``, which simplifies the writing of the code. +//! `{id:guid}`, which simplifies the writing of the code. pub mod filters; pub use filters::*;