Re: Match 2 words and more

From: Guyren Howe <guyren(at)gmail(dot)com>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Match 2 words and more
Date: 2021-11-28 00:56:25
Message-ID: ADC6377F-C58E-428B-966B-F77C93ABF816@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 27, 2021, at 16:27 , Shaozhong SHI <shishaozhong(at)gmail(dot)com> wrote:
>
> select name FROM a_table where "STREET_NAME" ~ '^[[:alpha:]+ ]+[:alpha:]+$’;

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

select name FROM a_table where "STREET_NAME" ~ ‘^([[:alpha:]]+\s)+[[:alpha:]]+$’;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-11-28 01:27:26 Re: Match 2 words and more
Previous Message Alvaro Herrera 2021-11-28 00:49:07 Re: Match 2 words and more