Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i89LP-0007T7-51 for pgsql-sql@arkaria.postgresql.org; Wed, 11 Sep 2019 20:36:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i89LN-0004mP-QX for pgsql-sql@arkaria.postgresql.org; Wed, 11 Sep 2019 20:36:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i89LN-0004bA-Am for pgsql-sql@lists.postgresql.org; Wed, 11 Sep 2019 20:36:01 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i89LL-0004d4-3S for pgsql-sql@postgresql.org; Wed, 11 Sep 2019 20:36:00 +0000 Received: by mail-qt1-x830.google.com with SMTP id n7so26998766qtb.6 for ; Wed, 11 Sep 2019 13:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=YV1QGqZXeDYsCQ0d1Bnix9tRxZ0BGHsBm2NHagKVUAo=; b=io+KVej1nP9Nkr6Z+EDv72FskLiGYLsq6L5KRQX+mCxWXhpqtNAwz5Kz6OojEhTS/E 656IX7/K517NeFF3AFtkEFCL5e+AudEqx5O+Z6+QLB7ejz5cnnR/sn8IpwR1tR1BsyRg ybD+vbjq1gf1Fzho55ORrK0IZW9KE+etig/Vk/NLJieB1Oc8973zKmn51PfOy4KnAkTd 5yYQPs+gpZrzFpjWPGK1X4qqw1dRzA6m7d7NwF2rfGUg/ipxU1lprZbaMnJVAYui8kR5 04mLRT8YsjICUzGJUAO0UlVlxHAHubpq2NkMpU5YCTj4diquAtqOMqYDnpb37K7q8Akp EFGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=YV1QGqZXeDYsCQ0d1Bnix9tRxZ0BGHsBm2NHagKVUAo=; b=ap+jf9QmawiqMA57vRdQsgcathqVYx6dhQFZzSf/6qz7Jk6W45zmLUTkV2E0ZYDNmy fQV3gO5cRMnrimlh6O2rTe0yoM20QDlsCixH22kIS6dU59KHSLywv2W8CYZDWH2nl6s7 XzhyJnnFYmiUtpJdBU9yWreeTQLsyoWmOyKY4/sXacjm3Gvjpkhc6rBI5TF62YNTDH8I utT3FVBGlYitpV7bgd8akMMcDprxLWZ8HYlZNU9lugzMh62wv2jqcOndhMMPfpO3feuf 3TdW/Y8hA0YyAbRd870U5gDjUKHG4Wom1BwfQ9NELQ1CYan64tiovl355rKaJG6bHYvr MzGg== X-Gm-Message-State: APjAAAWXa5q/Bok+45mJngaceZ9OoN6aJBsntDVxTkpcgzrm92PoKRhr wMiZrNPzs+m2ZHcmIXkf/7ch9BFreTY= X-Google-Smtp-Source: APXvYqwH3+hKS+8p+ET+xmqAxgze/cL02F63rBkNh62OTiHoeKz4gBy4UPd9B+liSBQYULte/9gKwg== X-Received: by 2002:a63:30c6:: with SMTP id w189mr33639504pgw.398.1568233670058; Wed, 11 Sep 2019 13:27:50 -0700 (PDT) Received: from [10.106.130.163] ([155.100.47.3]) by smtp.gmail.com with ESMTPSA id 127sm42507651pfy.56.2019.09.11.13.27.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Sep 2019 13:27:49 -0700 (PDT) From: Rob Sargent Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_F8C1CDD0-FB15-48E5-9757-B6B0AC52800C" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Find and replace Date: Wed, 11 Sep 2019 14:27:48 -0600 In-Reply-To: <35490FCC-14AF-4D90-BF6E-A4F00518E41E@illinois.edu> Cc: "pgsql-sql@postgresql.org" To: "Campbell, Lance" References: <35490FCC-14AF-4D90-BF6E-A4F00518E41E@illinois.edu> X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_F8C1CDD0-FB15-48E5-9757-B6B0AC52800C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 11, 2019, at 2:24 PM, Campbell, Lance = wrote: >=20 > PostgreSQL 10.x > =20 > I don=E2=80=99t 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.=20 > =20 > 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. > =20 > Example: > {ab_1D3-4} becomes {{ab_1D3-4}} > =20 > Thanks for helping me with this. > =20 > Lance Campbell > University of Illinois Are there curly braces which don=E2=80=99t start/end such strings? If = not it might be easier to just double them up? --Apple-Mail=_F8C1CDD0-FB15-48E5-9757-B6B0AC52800C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Sep 11, 2019, at 2:24 PM, Campbell, Lance <lance@illinois.edu> = wrote:

PostgreSQL 10.x
 
I don=E2=80=99t = 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

Are there curly braces which don=E2=80=99t = start/end such strings?  If not it might be easier to just double = them up?


= --Apple-Mail=_F8C1CDD0-FB15-48E5-9757-B6B0AC52800C--