Re: Match 2 words and more

Поиск
Список
Период
Сортировка
От Thomas Markus
Тема Re: Match 2 words and more
Дата
Msg-id f0712672-3a2a-11bf-e94b-801ebfb2ccf0@proventis.net
обсуждение исходный текст
Ответ на Match 2 words and more  (Shaozhong SHI <shishaozhong@gmail.com>)
Список pgsql-general

Am 28.11.21 um 01:27 schrieb Shaozhong SHI:
> this is supposed to find those to have 2 words and more.
>
> select name FROM a_table where "STREET_NAME" ~ '^[[:alpha:]+ 
> ]+[:alpha:]+$';
>
> But, it finds only one word as well.
>
> It appears that regex is not robust.
>
> Can anyone shed light on this?
>
> Regards,
>
> David
Hi,

It's robust, but syntax is sometimes weired

for words I would use something like (contains numbers too)
"STREET_NAME" ~ '(\w+\s+)+\w+';

or alpha only
"STREET_NAME" ~ '([[:alpha:]]+\s+)+[[:alpha:]]+'

regards
Thomas



В списке pgsql-general по дате отправления:

Предыдущее
От: Gavin Flower
Дата:
Сообщение: Re: [EXTERNAL] Re: Inserts and bad performance
Следующее
От: Wicher
Дата:
Сообщение: DDL tools for working with views in dependency order?