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 AggOr<P::Aggregate>>::Output as AggOr<R::Aggregate>>::Output as AggOr<F::Aggregate>>::Output>where
V: SQLParam + 'a,
V::DialectMarker: PostgresStringSupport,
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,
E::Aggregate: AggOr<P::Aggregate>,
<E::Aggregate as AggOr<P::Aggregate>>::Output: AggOr<R::Aggregate>,
<<E::Aggregate as AggOr<P::Aggregate>>::Output as AggOr<R::Aggregate>>::Output: AggOr<F::Aggregate>,Expand description
REGEXP_REPLACE with flags - replaces substrings matching a POSIX regex (PostgreSQL).
Common flags: "g" (global), "i" (case-insensitive), "gi" (both).
ยงExample
use drizzle_core::expr::regexp_replace_flags;
// SELECT REGEXP_REPLACE(users.phone, '[^0-9]', '', 'g')
let digits_only = regexp_replace_flags(users.phone, "[^0-9]", "", "g");