Skip to main content

regex_replace

Function regex_replace 

Source
pub fn regex_replace<S, P, R, SP, O>(
    source: impl IntoExpr<S>,
    pattern: impl IntoExpr<P>,
    replacement: impl IntoExpr<R>,
    flags: RegexReplaceFlags,
) -> Expr<O>
where S: StringBinaryExpr<P, String, Output = SP>, SP: StringBinaryExpr<R, String, Output = O>,
Expand description

Replaces the first POSIX regular-expression match in source, or returns source unchanged when none exists. RegexReplaceFlags::GLOBAL replaces every match; RegexReplaceFlags::CASE_INSENSITIVE ignores case. replacement supports PostgreSQL backreferences (\1 through \9, \&, and \\ for a literal backslash). Returns NULL if source, pattern, or replacement is NULL. Maps to PostgreSQL REGEXP_REPLACE.