Re: Regular Expression For Duplicate Words

2022-02-03 Thread Shaozhong SHI
Hi, Peter, Interesting. On Thu, 3 Feb 2022 at 19:48, Peter J. Holzer wrote: > On 2022-02-02 08:00:00 +, Shaozhong SHI wrote: > > regex - Regular Expression For Duplicate Words - Stack Overflow > > > > Is there any example in Postgres? > > It's pretty much the same as with other regexp diale

Re: Regular Expression For Duplicate Words

2022-02-03 Thread Peter J. Holzer
On 2022-02-02 08:00:00 +, Shaozhong SHI wrote: > regex - Regular Expression For Duplicate Words - Stack Overflow > > Is there any example in Postgres? It's pretty much the same as with other regexp dialects: User word boundaries and a word character class to match any word and then use a back

Re: Regular Expression For Duplicate Words

2022-02-02 Thread Jian He
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

Re: Regular Expression For Duplicate Words

2022-02-02 Thread David G. Johnston
On Wed, Feb 2, 2022 at 1:00 AM Shaozhong SHI wrote: > This link is interesting. > > regex - Regular Expression For Duplicate Words - Stack Overflow > > > Is there any example in Postgres? > > Not that I'm immedia