pub fn regexp_replace_flags<'a, V, E, P, R, F>(
expr: E,
pattern: P,
replacement: R,
flags: F,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, E::Nullable, <<<E::Aggregate as AggregateKind>::Or<P::Aggregate> as AggregateKind>::Or<R::Aggregate> as AggregateKind>::Or<F::Aggregate>, (E::Sources, (P::Sources, (R::Sources, F::Sources)))>where
V: SQLParam + 'a,
V::DialectMarker: DialectSupports<PostgresString>,
E: Expr<'a, V>,
E::SQLType: Textual,
P: Expr<'a, V>,
P::SQLType: Textual,
P::Aggregate: AggregateKind,
R: Expr<'a, V>,
R::SQLType: Textual,
R::Aggregate: AggregateKind,
F: Expr<'a, V>,
F::SQLType: Textual,
F::Aggregate: AggregateKind,Expand description
Replaces POSIX regular expression matches, with flags, on PostgreSQL.
Like regexp_replace with a fourth argument: renders
REGEXP_REPLACE(expr, pattern, replacement, flags).
Common flags: "g" (every match), "i" (ignore case), "gi" (both). All
arguments must be text. The result is text and keeps expr’s
nullability.
§Examples
let digits = regexp_replace_flags(users.name, "[^0-9]", "", "g");
assert_eq!(digits.sql(), r#"REGEXP_REPLACE ("users"."name", $1, $2, $3)"#);