Re: Regular Expression For Duplicate Words

Поиск
Список
Период
Сортировка
От Jian He
Тема Re: Regular Expression For Duplicate Words
Дата
Msg-id CAMV54g1x=PDL4QPfp_BmBd93KtFfndG-SmK+hhvdQd-PW=VtaA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Regular Expression For Duplicate Words  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general

It's an interesting question. But I also don't know how to do it in PostgreSQL.
But I figured out alternative solutions.

GNU Grep:    grep -E '(hello)[[:blank:]]+\1' <<<'one hello hello world'
ripgrep:     rg  '(hello)[[:blank:]]+\1' --pcre2  <<<'one hello hello world'

On Wed, Feb 2, 2022 at 8:53 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, Feb 2, 2022 at 1:00 AM Shaozhong SHI <shishaozhong@gmail.com> wrote:
This link is interesting.


Is there any example in Postgres?


Not that I'm immediately aware of, and I'm not going to search the internet for you.

The regex capabilities in PostgreSQL are pretty full-featured so a solution should be possible.  You should try translating the SO post concepts into PostgreSQL yourself and ask specific questions if you get stuck.

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_basebackup with hostssl ?
Следующее
От: Laura Smith
Дата:
Сообщение: Re: pg_basebackup with hostssl ?