summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--library/src/compute/construct.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/src/compute/construct.rs b/library/src/compute/construct.rs
index 04195f42..e7e05eee 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<EcoString>,
) -> Value {
Regex::new(&regex.v).at(regex.span)?.into()