pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: abdulrahim.s@gmail.com
Subject: REGEXP_REPLACE : How to use a column value in the regex
Date: Mon, 17 Feb 2020 06:37:11 +0000
Message-ID: <158192143115.6745.7931715775932027756@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/functions-matching.html
Description:

The documentation doesn't talk about any regex syntax for using a column
from the db in the pattern. There is no mention if this is NOT supported.
All the examples are using static string and none using a DB column
values.
e.g. I have a field *portfolio* which had data like CloudPlatform (Public),
CloudPlatform (Private), MobilePlatfom (Public),.. etc
These values are coming from another table *platformtypes" which has these
values Public, Private, Hybrid...etc.
I want to replace these types from the portfolio names, i was able to do it
using string 
*SELECT
Portfolios.PortfolioName,REGEXP_REPLACE(Portfolios.PortfolioName,'(\(Public\))',''),
but I would like to use something  like 
*REGEXP_REPLACE(Portfolios.PortfolioName,'(\(platformtypes.Name\)),'')*


view thread (2+ messages)  latest in thread

Message-ID: <158192143115.6745.7931715775932027756@wrigleys.postgresql.org>
Permalink:  ../158192143115.6745.7931715775932027756@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/158192143115.6745.7931715775932027756@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, abdulrahim.s@gmail.com
  Subject: Re: REGEXP_REPLACE : How to use a column value in the regex
  In-Reply-To: <158192143115.6745.7931715775932027756@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox