Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sorDF-00EKAz-9v for pgsql-admin@arkaria.postgresql.org; Thu, 12 Sep 2024 21:18:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sorDE-000HQf-Lx for pgsql-admin@arkaria.postgresql.org; Thu, 12 Sep 2024 21:18:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sorDE-000HQW-8d for pgsql-admin@lists.postgresql.org; Thu, 12 Sep 2024 21:18:48 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sorD8-000sON-Q9 for pgsql-admin@lists.postgresql.org; Thu, 12 Sep 2024 21:18:47 +0000 Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-4582face04dso12839001cf.1 for ; Thu, 12 Sep 2024 14:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aweber.com; s=2018090500; t=1726175922; x=1726780722; darn=lists.postgresql.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=nNRqE4Uqkra5B+LaH3ep3gfa3kwfSRhjJaxGJ2oA1n8=; b=nEe59F28y7Q/Q3MQphsBY1qTIQszUwzoWxp1DOKpZxjAtfwOpCdb5GrtIn+DKaEZVN 13/JDz00o279XGB4roHrBnnXZGljWYdiRszMerlt3dMtwdnRzVg1eUSfhTPTnB2BZn2J osjS/MOlZk7R2fMLfARSfdGSiTAzPUX5M38HpSpWkhED3HB77CDNDWtJqYEY+v5hCoZx lU97VUk5vH5jVl4gLAZhZ1i1MC561DRReVPF3+kiria+VrCyKUQmQbb+1M/Sd90c9ToH SuUmhi6grjbscEyKST9S+ovWFMGo+hotq+BaEkCRkLyHRr9nnEqU7cF0R9ahUhJc/pdl BL/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726175922; x=1726780722; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nNRqE4Uqkra5B+LaH3ep3gfa3kwfSRhjJaxGJ2oA1n8=; b=kXdZp4l4gQHeZQg3KRdp8mv0nBm1kFIInUf0F1ve2shmsk5897E57591cT/4XPu9ef jM6GxSe1o5efyoCqvDGGys5Nw/yK/JsPLnmHyElpDXXZr0cm78xHVMTieQcJBETmnvFH UlJvZvzLLITg7bvCxiDsKMxB8LUrQwowRU+EIJSxpVrwBkFQtB0Vb5UODtQjFeCmMeZx vxCqZcT8rgTaoTTUtNU/ySj+9XkQryC/EepZHzx5li+p6DYoDJC+dvxA6PHfa6kC/3FD OEyPDFJljX+RSVdy80r54LaRk1TQX2aemLalg4IyT8FrADbwqXtFxjeZwGLpTc0G4Mgl W2IQ== X-Gm-Message-State: AOJu0YwvkMeTmuKLQbOi2qSsLKLKGNUX+lAjFi9cvETFi21kSZ0SkHyl JluWvRuiJGY9TG7s2Rn2UofmzI1EQBuErjZYn/KJdcuyWeNsgS4g6ABnQUCwTjWe21CK9tt3QXN 3tV8= X-Google-Smtp-Source: AGHT+IG+u0AnCg1yf2+coM3g7CBOfaCtDjCCkoZRZ3SgtgYlt5oabbo8JZk1QlWemd9g7hUzw30H8g== X-Received: by 2002:ac8:5d07:0:b0:458:2f3d:dd53 with SMTP id d75a77b69052e-4583c75da70mr152403501cf.17.1726175922039; Thu, 12 Sep 2024 14:18:42 -0700 (PDT) Received: from smtpclient.apple ([172.58.252.70]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822f60a4csm56914771cf.62.2024.09.12.14.18.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Sep 2024 14:18:41 -0700 (PDT) From: Chris Hoover Content-Type: multipart/alternative; boundary="Apple-Mail=_46142D4E-FCE5-436A-A7F6-0E84AFD396BF" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Regexp_replace help Message-Id: <18A99BB3-EB26-47A3-94D6-D951E984D982@aweber.com> Date: Thu, 12 Sep 2024 17:18:30 -0400 To: pgsql-admin@lists.postgresql.org X-Mailer: Apple Mail (2.3776.700.51) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_46142D4E-FCE5-436A-A7F6-0E84AFD396BF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Looking for some help here. I have a string that has =E2=80=98code1234=E2= =80=99 in it. The 1234 can vary and I won=E2=80=99t know what they = would be. Trying to figure out how to use regexp_replace to trim down = the string, but unsure how to keep the =E2=80=98code1234=E2=80=99 in the = string. The search should be =E2=80=98 code[0-9]+? .*=E2=80=99. However, I = don=E2=80=99t understand what the replace should be. I.E.: SELECT regexp_replace(=E2=80=99This is my test string that caused code12 = from abc=E2=80=99, =E2=80=98 code[0-9]+? .*=E2=80=99= , =E2=80=98What should this be so = I keep the code12?=E2=80=98) Desire result: =E2=80=99This is my test string that caused code12=E2=80=99 SELECT regexp_replace(=E2=80=99This is my second test string and it is = causing code1234 from def. The weather is nice. :)=E2=80=99, =E2=80=98 code[0-9]+? .*=E2=80=99= , =E2=80=98What should this be so = I keep the code1234?=E2=80=99) Desire result: =E2=80=98This is my second test string and it is causing code1234=E2=80=99= Thanks, Chris Hoover Senior DBA AWeber.com Cell: (803) 528-2269 Email: chrish@aweber.com --Apple-Mail=_46142D4E-FCE5-436A-A7F6-0E84AFD396BF Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Looking for = some help here.  I have a string that has =E2=80=98code1234=E2=80=99 = in it.  The 1234 can vary and I won=E2=80=99t know what they would = be.  Trying to figure out how to use regexp_replace to trim down = the string, but unsure how to keep the =E2=80=98code1234=E2=80=99 in the = string.


The search should be =E2=80= =98 code[0-9]+? .*=E2=80=99. However, I don=E2=80=99t understand what = the replace should be.

I.E.:
SELECT = regexp_replace(=E2=80=99This is my test string that caused code12 from = abc=E2=80=99,
            =                     =          =E2=80=98 code[0-9]+? = .*=E2=80=99,
              =                     =        =E2=80=98What should this be so I keep the = code12?=E2=80=98)
Desire result:
=E2=80=99This is my test string that = caused code12=E2=80=99


SELECT = regexp_replace(=E2=80=99This is my second test string and it is causing = code1234 from def.  The weather is nice. = :)=E2=80=99,
            =                     =          =E2=80=98 code[0-9]+? = .*=E2=80=99,
              =                     =        =E2=80=98What should this be so I keep the = code1234?=E2=80=99)
Desire result:
=E2=80=98This is my = second test string and it is causing code1234=E2=80=99

Thanks,


Chris = Hoover
Senior DBA
AWeber.com
Cell: (803) = 528-2269
Email: chrish@aweber.com



= --Apple-Mail=_46142D4E-FCE5-436A-A7F6-0E84AFD396BF--