MCPcopy Create free account
hub / github.com/davidblewett/rure-python / replace

Method replace

regex/src/re_bytes.rs:462–468  ·  view source on GitHub ↗

Replaces the leftmost-first match with the replacement provided. The replacement can be a regular byte string (where `$N` and `$name` are expanded to match capture groups) or a function that takes the matches' `Captures` and returns the replaced byte string. If no match is found, then a copy of the byte string is returned unchanged. # Replacement string syntax All instances of `$name` in the re

(
        &self,
        text: &'t [u8],
        rep: R,
    )

Source from the content-addressed store, hash-verified

460 /// # }
461 /// ```
462 pub fn replace<'t, R: Replacer>(
463 &self,
464 text: &'t [u8],
465 rep: R,
466 ) -> Cow<'t, [u8]> {
467 self.replacen(text, 1, rep)
468 }
469
470 /// Replaces all non-overlapping matches in `text` with the replacement
471 /// provided. This is the same as calling `replacen` with `limit` set to

Callers 2

mainFunction · 0.45
generate_fileFunction · 0.45

Calls 1

replacenMethod · 0.45

Tested by

no test coverage detected