Find and replace - Mailing list pgsql-sql

From Campbell, Lance
Subject Find and replace
Date
Msg-id 35490FCC-14AF-4D90-BF6E-A4F00518E41E@illinois.edu
Whole thread Raw
Responses Re: Find and replace
Re: Find and replace
List pgsql-sql

PostgreSQL 10.x

 

I don’t know the best way to do this.  I need to do a find and replace in text fields.  The value I need to find and replace may occur more than once in each field per record. 

 

The value I am trying to match on:

Starts with a single { .

Ends with a single } .

In between these brackets can be the characters 0-9, a-z, A-Z, hyphens and underscores.  But no spaces.  These characters could be in any order.

The replacement value on a match is the same as what was found except for double {{ at the beginning and double }} at the end.  Same values between the brackets as what was matched on.

 

Example:

{ab_1D3-4} becomes {{ab_1D3-4}}

 

Thanks for helping me with this.

 

Lance Campbell

University of Illinois

 

pgsql-sql by date:

Previous
From: Sebastien FLAESCH
Date:
Subject: Re: libpq: How are result sets fetched behind the scene?
Next
From: Rob Sargent
Date:
Subject: Re: Find and replace