baml.regex._replace

(internal) Shared body of `string.replace` (`all = false`) and `string.replace_all`.

Reference version

Signature

function baml.regex._replace(
haystack: string,
search: string | baml.regex.Regex,
replacement: string,
all: bool
) -> string throws never

(internal) Shared body of string.replace (all = false) and string.replace_all.

Source:<builtin>/baml/ns_regex/regex.bamlbytes 10894–11497