Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mr8Uf-0004YY-ML for pgsql-general@arkaria.postgresql.org; Sun, 28 Nov 2021 00:56:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mr8Ue-0004Ub-De for pgsql-general@arkaria.postgresql.org; Sun, 28 Nov 2021 00:56:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mr8Ue-0004US-0I for pgsql-general@lists.postgresql.org; Sun, 28 Nov 2021 00:56:36 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mr8Ub-0006Dw-Ae for pgsql-general@lists.postgresql.org; Sun, 28 Nov 2021 00:56:35 +0000 Received: by mail-pg1-x530.google.com with SMTP id q16so11794599pgq.10 for ; Sat, 27 Nov 2021 16:56:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=rV7fFu4lPXPqxprqTrHtgzdZnpeGZ1SEHdJ6VVJyGiE=; b=AKgV++2u0U2sutQYQj5A1IpFATLCizCbx6e72cW02/IdmBjtn9BMtYJMaogYzP/gYS 1I4nVp47QuOhjAfPp2kkIeNWEeHTVIm3C1KObE8tVuaSDR8j3X99E2qX+QItCL5mUTSb qgcH6x6Ci+x6mQmv8JeSZiV/FzqmyhXlhXu82GeWKZ7Y3+BFgur82gm+oaCZOMorqy6t wu7PVQEM+Bw9NJwgUST7dg5KM6X5qT1Nn9ycv6UQ+rbB4s224MGA1G8OSDdOgNOf7blc I3SMuBjAYQWtTRTcvTJriPVUYd0vI4b0QwhKQk5LJy0TL7btKRkoGEaPk4jwPTz6kIzH ya6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=rV7fFu4lPXPqxprqTrHtgzdZnpeGZ1SEHdJ6VVJyGiE=; b=CHmkckkZ2TqZ/b6INHPW/QEO79IAOtv5tFwtJUhDvIdbXr57AeiW/mgxyP0NuZl+Hd R7BTTKDXrbRaD55D9SaTwusa+7oD2caB0CpxXT9mrQylcQJkuy8987HKBATOxa+04dZi TFgItqgIYNshAlBm4+LrFBQqVKH+uUj9GQ2aJQPBUsRRrr1tBIHGjwg073RElk5Bmg2v iqpZuDK3M7LQVKlHERShlZIB22oGjXwAyl20Z/iDdBQvYeZMOUQjRlYh8kMTyOqjopSM //fjKBfAo7aNyNQrH8X/GTJCzTWRfT2hsiI7iOWC/KFQLixiPsETKOhjKBANomu5ANoC 4tTQ== X-Gm-Message-State: AOAM531SyYP058xKv3eVfMjVeS27y0siKiG9mdrd1eZy/U+2s7lCdq9p 9/hVoRSCcBRegF74WlEBosQ= X-Google-Smtp-Source: ABdhPJyy54btnRgWM04Ukl7a+rv1P5TfzX3mk0qrMONyW890AdS4/iWLQlSo6ZpcTYHVRKs4zRY2Pw== X-Received: by 2002:a05:6a00:1783:b0:49f:c134:c6e2 with SMTP id s3-20020a056a00178300b0049fc134c6e2mr30705807pfg.0.1638060991278; Sat, 27 Nov 2021 16:56:31 -0800 (PST) Received: from smtpclient.apple ([2600:8801:8800:2::13]) by smtp.gmail.com with ESMTPSA id p124sm11427755pfg.110.2021.11.27.16.56.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Nov 2021 16:56:30 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_4F2C235D-4468-4759-B755-7F7A8B20E51D" Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Subject: Re: Match 2 words and more From: Guyren Howe In-Reply-To: Date: Sat, 27 Nov 2021 16:56:25 -0800 Cc: "pgsql-general@lists.postgresql.org" X-Mailbutler-Message-Id: CB81C282-2649-43A1-B50D-2CB58C228B70 Message-Id: References: To: Shaozhong SHI X-Mailer: Apple Mail (2.3693.20.0.1.32) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_4F2C235D-4468-4759-B755-7F7A8B20E51D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Nov 27, 2021, at 16:27 , Shaozhong SHI = wrote: >=20 > select name FROM a_table where "STREET_NAME" ~ '^[[:alpha:]+ = ]+[:alpha:]+$=E2=80=99; The simplest thing that does what you says is I think: select name FROM a_table where "STREET_NAME" ~ = =E2=80=98^([[:alpha:]]+\s)+[[:alpha:]]+$=E2=80=99; --Apple-Mail=_4F2C235D-4468-4759-B755-7F7A8B20E51D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 On = Nov 27, 2021, at 16:27 , Shaozhong SHI <shishaozhong@gmail.com> wrote:

select = name FROM a_table where "STREET_NAME" ~ '^[[:alpha:]+ = ]+[:alpha:]+$=E2=80=99;

The simplest thing that does what you says is I = think:

select name FROM a_table where "STREET_NAME" ~ =E2=80=98^([[:alpha:]]+\s)+[[:alpha:]]+$=E2=80=99;
= --Apple-Mail=_4F2C235D-4468-4759-B755-7F7A8B20E51D--