parent
2d6a79ba32
commit
10a3fbd174
|
|
@ -383,6 +383,10 @@ pub fn regex(
|
||||||
/// escape sequences. To produce regex escape sequences that are also valid in
|
/// 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
|
/// Typst (e.g. `[\\]`), you need to escape twice. Thus, to match a verbatim
|
||||||
/// backslash, you would need to write `{regex("\\\\")}`.
|
/// 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>,
|
regex: Spanned<EcoString>,
|
||||||
) -> Value {
|
) -> Value {
|
||||||
Regex::new(®ex.v).at(regex.span)?.into()
|
Regex::new(®ex.v).at(regex.span)?.into()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue