diff --git a/library/src/compute/construct.rs b/library/src/compute/construct.rs index 04195f421..e7e05eeea 100644 --- a/library/src/compute/construct.rs +++ b/library/src/compute/construct.rs @@ -383,6 +383,10 @@ pub fn regex( /// escape sequences. To produce regex escape sequences that are also valid in /// Typst (e.g. `[\\]`), you need to escape twice. Thus, to match a verbatim /// backslash, you would need to write `{regex("\\\\")}`. + /// + /// If you need many escape sequences, you can also create a raw element + /// and extract its text to use it for your regular expressions: + /// ```{regex(`\d+\.\d+\.\d+`.text)}```. regex: Spanned, ) -> Value { Regex::new(®ex.v).at(regex.span)?.into()