mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
parent
2d6a79ba32
commit
10a3fbd174
@ -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(®ex.v).at(regex.span)?.into()
|
||||
|
Loading…
x
Reference in New Issue
Block a user